Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4313885
Votes 6
Synopsis Scanning and formatting [scanning]
Category java:classes_nio
Reported Against 1.1 , 1.3 , 1.1.6 , 1.1.7 , tiger , 1.2fcs , 1.2beta2 , 1.0alpha3 , merlin-beta
Release Fixed 1.5(tiger)
State 10-Fix Delivered, request for enhancement
Priority: 3-Medium
Related Bugs 1218891 , 4004086 , 4072400 , 4175609 , 4286936 , 4313888 , 4418975 , 4639368 , 4906370
Submit Date 18-FEB-2000
Description
An API for text scanning (based upon regular expressions) and formatting
(in the spirit of C's printf procedure).  This API will bring regular
expressions and a compact notation for formatted output to the Java
platform.
Work Around
N/A
Evaluation
In progress for Tiger.  --  xxxxx@xxxxx  2002/2/20

The scanner API has been approved and the first implementation putback.
 xxxxx@xxxxx  2003-09-22
Comments
  
  Include a link with my name & email   

Submitted On 12-JAN-2001
dr_willie
So when is the Merlin release with regular expressions 
going to be available?


Submitted On 22-JUN-2001
p.lavarre
> formatted output ...
> on a par with other popular platforms ...

Not.

jsr-51-comments at jcp.org assures me we shouldn't read 
jsr/detail/051.jsp as a promise of console i/o that works.

Vote at bugs/4071281.html if you care.  Be sure to notice 
even System.err is broke if you use System.in to read lines 
in.


Submitted On 22-JUN-2001
p.lavarre
"JSR-051" here means
http://jcp.org/jsr/detail/051.jsp


Submitted On 11-FEB-2004
kaffiene
Ugh!  How can the scanner API be considered as a 'solution'
to not having scanf in Java???

This single line:

sscanf(myString, "%[^abcw-z] %*d %l %n", &myLong, &myInt);

Is not even remotely possible with the scanner API, and
taking away the fancier bits of sscanf, even just

sscanf(myString, "%d %d %d %d", &a, &b, &c &d);

Is many many lines of code in Java using the Scanner API
rather than the concise C representation.

If the class primitives types (Integer, Float etc...)
weren't invariant, you'd have a perfect solution with the
addition of varargs and autboxing that were added in 1.5. 
An almost direct scanf work-alike would be possible. But as
it is, this is *not* possible and is one of the biggest
omissions in the language.

The Scanner API is *not* a solution to this issue!



PLEASE NOTE: JDK6 is formerly known as Project Mustang