public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libgcj/3582: Class.forName busted?
@ 2001-07-12 21:30 tromey
  0 siblings, 0 replies; 2+ messages in thread
From: tromey @ 2001-07-12 21:30 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, green, java-prs, nobody, tromey

Synopsis: Class.forName busted?

Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Thu Jul 12 21:30:15 2001
Responsible-Changed-Why:
    I'm taking this.
    Sorry it took me so long to look at it.
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Thu Jul 12 21:30:15 2001
State-Changed-Why:
    foo/bar/bing/MySharedClass.java is missing the
    correct `package' statement.
    If you add the package statement, this works.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3582&database=gcc


^ permalink raw reply	[flat|nested] 2+ messages in thread

* libgcj/3582: Class.forName busted?
@ 2001-07-05 18:56 Anthony Green
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Green @ 2001-07-05 18:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3582
>Category:       libgcj
>Synopsis:       Class.forName busted?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 05 18:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anthony Green
>Release:        3.1 20010705 (experimental)
>Organization:
>Environment:
System: Linux fencer.cygnus.com 2.2.12-20smp #1 SMP Mon Sep 27 10:34:45 EDT 1999 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-language=c,c++,java --enable-threads --prefix=/horton/green/net/i : (reconfigured) 
>Description:
	The following test code doesn't work (at least, on x86 Linux).
I thought foo.bar.bing.MySharedClass is supposed to get picked out of foo-bar.so.
>How-To-Repeat:
	Extract this test case and run `make'

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2001-07-05 18:45 PDT by <green@fencer.cygnus.com>.
# Source directory was `/horton/green/sobad'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#     47 -rw-rw-r-- foo/bar/bing/MySharedClass.java
#    302 -rw-rw-r-- Makefile
#    353 -rw-rw-r-- MyTester.java
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh08800; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= foo/bar/bing/MySharedClass.java ==============
if test ! -d 'foo'; then
  $echo 'x -' 'creating directory' 'foo'
  mkdir 'foo'
fi
if test ! -d 'foo/bar'; then
  $echo 'x -' 'creating directory' 'foo/bar'
  mkdir 'foo/bar'
fi
if test ! -d 'foo/bar/bing'; then
  $echo 'x -' 'creating directory' 'foo/bar/bing'
  mkdir 'foo/bar/bing'
fi
if test -f 'foo/bar/bing/MySharedClass.java' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'foo/bar/bing/MySharedClass.java' '(file already exists)'
else
  $echo 'x -' extracting 'foo/bar/bing/MySharedClass.java' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'foo/bar/bing/MySharedClass.java' &&
public class MySharedClass
{
X  public int x;
}
SHAR_EOF
  (set 20 01 07 05 18 28 29 'foo/bar/bing/MySharedClass.java'; eval "$shar_touch") &&
  chmod 0664 'foo/bar/bing/MySharedClass.java' ||
  $echo 'restore of' 'foo/bar/bing/MySharedClass.java' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo './foo/bar/bing/MySharedClass.java:' 'MD5 check failed'
c43bbf8da59ee83eb3be50f18624aafa  ./foo/bar/bing/MySharedClass.java
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'foo/bar/bing/MySharedClass.java'`"
    test 47 -eq "$shar_count" ||
    $echo 'foo/bar/bing/MySharedClass.java:' 'original size' '47,' 'current size' "$shar_count!"
  fi
fi
# ============= Makefile ==============
if test -f 'Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'Makefile' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
all: MyTester foo-bar.so
X	LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./MyTester
X
MyTester: MyTester.java
X	gcj -o MyTester --main=MyTester MyTester.java
X
foo-bar.so: foo/bar/bing/MySharedClass.java
X	gcj -shared -fPIC -o foo-bar.so $<
X
clean:
X	-rm -rf *.so `find ./ -name \*.class` `find ./ -name \*~` MyTester
SHAR_EOF
  (set 20 01 07 05 18 42 49 'Makefile'; eval "$shar_touch") &&
  chmod 0664 'Makefile' ||
  $echo 'restore of' 'Makefile' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo './Makefile:' 'MD5 check failed'
48127929a5b5da1670326b48608c592b  ./Makefile
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Makefile'`"
    test 302 -eq "$shar_count" ||
    $echo 'Makefile:' 'original size' '302,' 'current size' "$shar_count!"
  fi
fi
# ============= MyTester.java ==============
if test -f 'MyTester.java' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'MyTester.java' '(file already exists)'
else
  $echo 'x -' extracting 'MyTester.java' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'MyTester.java' &&
public class MyTester
{
X  public static void main (String[] args)
X  {
X    Class c = null;
X
X    System.out.println ("Attemping to load foo.bar.bing.MySharedClass");
X
X    try
X      {
X	c = Class.forName ("foo.bar.bing.MySharedClass");
X      }
X    catch (ClassNotFoundException e)
X      {
X	System.err.println (e);
X      }
X
X    System.out.println (c);
X  }
}
SHAR_EOF
  (set 20 01 07 05 18 30 52 'MyTester.java'; eval "$shar_touch") &&
  chmod 0664 'MyTester.java' ||
  $echo 'restore of' 'MyTester.java' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo './MyTester.java:' 'MD5 check failed'
02439f8e62d83ce69d90fa672c594f7f  ./MyTester.java
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'MyTester.java'`"
    test 353 -eq "$shar_count" ||
    $echo 'MyTester.java:' 'original size' '353,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh08800
exit 0

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-07-12 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12 21:30 libgcj/3582: Class.forName busted? tromey
  -- strict thread matches above, loose matches on Subject: below --
2001-07-05 18:56 Anthony Green

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).