public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/7292: java.lang.Character.toString(char) should be static
@ 2002-07-12 13:36 jmr
  0 siblings, 0 replies; 2+ messages in thread
From: jmr @ 2002-07-12 13:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7292
>Category:       libgcj
>Synopsis:       java.lang.Character.toString(char) should be static
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 12 13:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jesse Rosenstock
>Release:        3.2 20020710 (experimental)
>Organization:
>Environment:
System: Linux churchill 2.4.3-12 #1 Fri Jun 8 15:05:56 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/home/user/jmr/app/gcc
>Description:
	java.lang.Character.toString(char) should be static, but it isn't.
>How-To-Repeat:
        Create C.java:

        public class C {
            void f() {
                Character.toString('x');
            }
        }

        gcj -v C.java gives:

        Reading specs from /home/user/jmr/app/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
        Reading specs from /home/user/jmr/app/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/../../../libgcj.spec
        rename spec lib to liborig
        Configured with: ./configure --prefix=/home/user/jmr/app/gcc
        Thread model: single
        gcc version 3.2 20020710 (experimental)
         /home/user/jmr/app/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/jc1 C.java -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase C.java -g1 -version -o /tmp/ccR1HymH.s
        GNU Java version 3.2 20020710 (experimental) (i686-pc-linux-gnu)
                compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-85).
        Class path starts here:
            /home/user/jmr/gcj_test/char/
            /home/user/jmr/app/gcc/share/java/libgcj-3.2.jar/ (system) (zip)
        C.java: In class `C':
        C.java: In method `C.f()':
        C.java:3: error: Can't make static reference to method `java.lang.String java.lang.Character.toString(char)' in class `java.lang.Character'.
                   Character.toString('x');
                            ^
        1 error

        This works with javac, and according to the sun javadoc, that
        method should be static.

        Workaround is to use String.valueOf(char) instead.
>Fix:
*** Character.java.orig Fri Jul 12 13:20:44 2002
--- Character.java      Fri Jul 12 13:20:58 2002
***************
*** 1488,1494 ****
     * @return a String containing the character
     * @since 1.4
     */
!   public String toString(char ch)
    {
      // This assumes that String.valueOf(char) can create a single-character
      // String more efficiently than through the public API.
--- 1488,1494 ----
     * @return a String containing the character
     * @since 1.4
     */
!   public static String toString(char ch)
    {
      // This assumes that String.valueOf(char) can create a single-character
      // String more efficiently than through the public API.
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: libgcj/7292: java.lang.Character.toString(char) should be static
@ 2002-07-12 14:08 tromey
  0 siblings, 0 replies; 2+ messages in thread
From: tromey @ 2002-07-12 14:08 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, java-prs, jmr, nobody, tromey

Synopsis: java.lang.Character.toString(char) should be static

Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-By: tromey
Responsible-Changed-When: Fri Jul 12 14:08:35 2002
Responsible-Changed-Why:
    I'm handling this.
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Fri Jul 12 14:08:35 2002
State-Changed-Why:
    Thanks.  I'm checking in your patch on the trunk.
    I'll look at the 3.1 branch status and if it is ok I'll commit
    there as well.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7292


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-12 13:36 libgcj/7292: java.lang.Character.toString(char) should be static jmr
2002-07-12 14:08 tromey

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).