public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/20435] New: regex pattern compiling bug
@ 2005-03-15 17:39 green at redhat dot com
  2005-05-28 18:06 ` [Bug libgcj/20435] " ziga at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: green at redhat dot com @ 2005-03-15 17:39 UTC (permalink / raw)
  To: java-prs

The following test code (derived from the blojsom wiki code) exposes a bug in
our regex compiler....


import java.util.regex.Pattern;

public class pat
{
    private static final String YMD_PERMALINK_REGEX =
"/(\\d\\d\\d\\d)/(\\d{1,2}+)/(\\d{1,2}+)/(.+)";
    private static final Pattern YMD_PERMALINK_PATTERN =
Pattern.compile(YMD_PERMALINK_REGEX, Pattern.UNICODE_CASE);

    public static void main (String[] args)
    {
        System.out.println ("ok");
    }
}



This should print "ok", but instead we get:

$ gij pat
Exception in thread "main" java.lang.ExceptionInInitializerError
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.util.regex.PatternSyntaxException: At position 8 in regular
expression pattern:
attempted to repeat a token that is already repeated
        /(\d\d\d\d)/(\d{1,2}+)/(\d{1,2}+)/(.+)
                ^
   at java.util.regex.Pattern.Pattern(java.lang.String, int)
(/usr/lib/libgcj.so.6.0.0)
   at java.util.regex.Pattern.compile(java.lang.String, int)
(/usr/lib/libgcj.so.6.0.0)
   at pat.<clinit>() (Unknown Source)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
   ...3 more

-- 
           Summary: regex pattern compiling bug
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: green at redhat dot com
                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=20435


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

* [Bug libgcj/20435] regex pattern compiling bug
  2005-03-15 17:39 [Bug libgcj/20435] New: regex pattern compiling bug green at redhat dot com
@ 2005-05-28 18:06 ` ziga at gcc dot gnu dot org
  2005-05-28 20:55 ` ziga at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ziga at gcc dot gnu dot org @ 2005-05-28 18:06 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From ziga at gcc dot gnu dot org  2005-05-28 18:06 -------
Confirmed.  This regular expression makes use of possessive quantifiers (?+, *+,
++, {n,m}+), which gnu.regexp doesn't support currently.  I've written some
Mauve test cases[1] for possessive quantifiers and will be sending a patch
adding the necessary support to classpath-patches shortly.

[1] http://sources.redhat.com/ml/mauve-patches/2005/msg00049.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ziga at gcc dot gnu dot org


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


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

* [Bug libgcj/20435] regex pattern compiling bug
  2005-03-15 17:39 [Bug libgcj/20435] New: regex pattern compiling bug green at redhat dot com
  2005-05-28 18:06 ` [Bug libgcj/20435] " ziga at gcc dot gnu dot org
@ 2005-05-28 20:55 ` ziga at gcc dot gnu dot org
  2005-06-01 22:11 ` cvs-commit at gcc dot gnu dot org
  2005-06-14 17:01 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: ziga at gcc dot gnu dot org @ 2005-05-28 20:55 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From ziga at gcc dot gnu dot org  2005-05-28 20:55 -------
Proposed patch:

http://thread.gmane.org/gmane.comp.java.classpath.patches/2416

-- 


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


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

* [Bug libgcj/20435] regex pattern compiling bug
  2005-03-15 17:39 [Bug libgcj/20435] New: regex pattern compiling bug green at redhat dot com
  2005-05-28 18:06 ` [Bug libgcj/20435] " ziga at gcc dot gnu dot org
  2005-05-28 20:55 ` ziga at gcc dot gnu dot org
@ 2005-06-01 22:11 ` cvs-commit at gcc dot gnu dot org
  2005-06-14 17:01 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-06-01 22:11 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-06-01 22:11 -------
Subject: Bug 20435

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ziga@gcc.gnu.org	2005-06-01 22:11:00

Modified files:
	libjava        : ChangeLog 
	libjava/gnu/regexp: RE.java RESyntax.java RETokenRepeated.java 
	libjava/java/util/regex: Pattern.java 

Log message:
	2005-06-01  Ziga Mahkovec  <ziga.mahkovec@klika.si>
	
	PR libgcj/20435:
	* gnu/regexp/RESyntax.java (RE_POSSESSIVE_OPS): New field.
	(static): Add possessive matching to JAVA_1_4 syntax.
	* gnu/regexp/RETokenRepeated.java (possessive): New field.
	(makePossessive, isPossessive): New methods.
	(match): Don't back off during possessive matching.
	* gnu/regexp/RE.java (initalize): Accept possessive quantifier.
	* java/util/regex/Pattern.java (constructor): Switch syntax from PERL5
	to JAVA_1_4.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3643&r2=1.3644
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/regexp/RE.java.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/regexp/RESyntax.java.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/regexp/RETokenRepeated.java.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/util/regex/Pattern.java.diff?cvsroot=gcc&r1=1.8&r2=1.9



-- 


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


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

* [Bug libgcj/20435] regex pattern compiling bug
  2005-03-15 17:39 [Bug libgcj/20435] New: regex pattern compiling bug green at redhat dot com
                   ` (2 preceding siblings ...)
  2005-06-01 22:11 ` cvs-commit at gcc dot gnu dot org
@ 2005-06-14 17:01 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-06-14 17:01 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From tromey at gcc dot gnu dot org  2005-06-14 17:01 -------
Fix checked in.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


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


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

end of thread, other threads:[~2005-06-14 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-15 17:39 [Bug libgcj/20435] New: regex pattern compiling bug green at redhat dot com
2005-05-28 18:06 ` [Bug libgcj/20435] " ziga at gcc dot gnu dot org
2005-05-28 20:55 ` ziga at gcc dot gnu dot org
2005-06-01 22:11 ` cvs-commit at gcc dot gnu dot org
2005-06-14 17:01 ` tromey 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).