public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes
@ 2005-08-01 17:38 hannes at helma dot at
  2005-08-01 17:51 ` [Bug classpath/23183] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hannes at helma dot at @ 2005-08-01 17:38 UTC (permalink / raw)
  To: java-prs

When using java.text.SimpleDateFormat to render a date, single quotes encoded as
'' (see <http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html>)
in the format string are swallowed in the output. The following code

   sdf = new SimpleDateFormat("''yyyy-MM-dd HH:mm:ss''");
   sdf.render(new Date());

produces something like this:

   2005-08-01 18:54:05

bug should actually produce:

   '2005-08-01 18:54:05'

Interestingly, using single quotes to escape other text works as supposed, and
using '' next to escaped text also causes the single quotes to appear. Thus, 

   sdf = new SimpleDateFormat(""'' '' '''FOO''' '' ''"");
   sdf.render(new Date());

produces:

    'FOO'

while it shold produce:

   ' ' 'FOO' ' '

PS: Maybe I should have reported this bug against Classpath, but I wasn't sure
which version of classpath is used in gcj 4.0.

-- 
           Summary: SimpleDateFormat fails to render '' as single quotes
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hannes at helma dot at
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug classpath/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
@ 2005-08-01 17:51 ` pinskia at gcc dot gnu dot org
  2005-08-01 18:02 ` [Bug libgcj/23183] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-01 17:51 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-01 17:51 -------
Confirmed on the mainline which means classpath .17+.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bug-classpath at gnu dot org
             Status|UNCONFIRMED                 |NEW
          Component|libgcj                      |classpath
     Ever Confirmed|                            |1
            Product|gcc                         |classpath
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-01 17:51:53
               date|                            |
            Version|4.0.0                       |0.17


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug libgcj/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
  2005-08-01 17:51 ` [Bug classpath/23183] " pinskia at gcc dot gnu dot org
@ 2005-08-01 18:02 ` pinskia at gcc dot gnu dot org
  2005-08-23 17:02 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-01 18:02 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-01 18:02 -------
Note: classpath's SimpleDateFormat has not been fully merged into libgcj.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|classpath                   |libgcj
            Product|classpath                   |gcc
            Version|0.17                        |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug libgcj/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
  2005-08-01 17:51 ` [Bug classpath/23183] " pinskia at gcc dot gnu dot org
  2005-08-01 18:02 ` [Bug libgcj/23183] " pinskia at gcc dot gnu dot org
@ 2005-08-23 17:02 ` tromey at gcc dot gnu dot org
  2005-08-24 22:33 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-08-23 17:02 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-08-23 17:02 -------
Here is the complete test case:

import java.text.*;
import java.util.*;

public class pr23183 {
  public static void main(String[] args) {
    SimpleDateFormat sdf = new SimpleDateFormat("''yyyy-MM-dd HH:mm:ss''");
    // Should have quotes around it, but does not.
    System.out.println(sdf.format(new Date()));

    // should produce ' ' 'FOO' ' '
    sdf = new SimpleDateFormat("'' '' '''FOO''' '' ''");
    System.out.println(sdf.format(new Date()));
  }
}


This fails with both gcj 4.1 and classpath cvs head (0.17+)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug libgcj/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
                   ` (2 preceding siblings ...)
  2005-08-23 17:02 ` tromey at gcc dot gnu dot org
@ 2005-08-24 22:33 ` tromey at gcc dot gnu dot org
  2005-08-25  2:10 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-08-24 22:33 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-08-24 22:33 -------
I'm testing a patch


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-08-01 17:51:53         |2005-08-24 22:33:52
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug libgcj/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
                   ` (3 preceding siblings ...)
  2005-08-24 22:33 ` tromey at gcc dot gnu dot org
@ 2005-08-25  2:10 ` tromey at gcc dot gnu dot org
  2005-08-25  2:11 ` cvs-commit at developer dot classpath dot org
  2005-09-06 12:57 ` [Bug classpath/23183] " mark at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-08-25  2:10 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-08-25 02:10 -------
I checked this in to classpath.
It should be pulled over to gcj at the next import.
I'll look at putting this on the 4.0 branch as well.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug libgcj/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
                   ` (4 preceding siblings ...)
  2005-08-25  2:10 ` tromey at gcc dot gnu dot org
@ 2005-08-25  2:11 ` cvs-commit at developer dot classpath dot org
  2005-09-06 12:57 ` [Bug classpath/23183] " mark at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at developer dot classpath dot org @ 2005-08-25  2:11 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at developer dot classpath dot org  2005-08-25 02:11 -------
Subject: Bug 23183

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch: 	
Changes by:	Tom Tromey <tromey@savannah.gnu.org>	05/08/25 02:04:36

Modified files:
	.              : ChangeLog 
	java/text      : SimpleDateFormat.java 

Log message:
	* java/text/SimpleDateFormat.java (compileFormat): Correctly
	handle quoted single quotes.  PR classspath/23183.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.4545&tr2=1.4546&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/java/text/SimpleDateFormat.java.diff?tr1=1.50&tr2=1.51&r1=text&r2=text






-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

* [Bug classpath/23183] SimpleDateFormat fails to render '' as single quotes
  2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
                   ` (5 preceding siblings ...)
  2005-08-25  2:11 ` cvs-commit at developer dot classpath dot org
@ 2005-09-06 12:57 ` mark at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mark at gcc dot gnu dot org @ 2005-09-06 12:57 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mark at gcc dot gnu dot org  2005-09-06 12:57 -------
Fixed checked in GNu Classpath, which will be released with 0.18.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
          Component|libgcj                      |classpath
            Product|gcc                         |classpath
         Resolution|                            |FIXED
   Target Milestone|---                         |0.18
            Version|4.0.0                       |unspecified


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23183


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

end of thread, other threads:[~2005-09-06 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-01 17:38 [Bug libgcj/23183] New: SimpleDateFormat fails to render '' as single quotes hannes at helma dot at
2005-08-01 17:51 ` [Bug classpath/23183] " pinskia at gcc dot gnu dot org
2005-08-01 18:02 ` [Bug libgcj/23183] " pinskia at gcc dot gnu dot org
2005-08-23 17:02 ` tromey at gcc dot gnu dot org
2005-08-24 22:33 ` tromey at gcc dot gnu dot org
2005-08-25  2:10 ` tromey at gcc dot gnu dot org
2005-08-25  2:11 ` cvs-commit at developer dot classpath dot org
2005-09-06 12:57 ` [Bug classpath/23183] " mark at gcc dot gnu dot org

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