Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #12846

Re: SimpleFormatter Question

From Novice <novice@example..com>
Newsgroups comp.lang.java.programmer
Subject Re: SimpleFormatter Question
Date 2012-03-10 17:55 +0000
Organization Your Company
Message-ID <XnsA012838CC3B11jpnasty@94.75.214.39> (permalink)
References <XnsA011D2474C732jpnasty@94.75.214.39> <4f5ab90d$0$289$14726298@news.sunsite.dk> <XnsA011F1BB1A949jpnasty@94.75.214.39> <XnsA011F3BCFD12Ajpnasty@94.75.214.39> <YDI6r.12585$wf.1272@newsfe09.iad>

Show all headers | View raw


Arved Sandstrom <asandstrom3minus1@eastlink.ca> wrote in
news:YDI6r.12585$wf.1272@newsfe09.iad: 

> On 12-03-10 12:57 AM, Novice wrote:
> [ SNIP ]
>> 
>> One followup question. When I tried this in my logging.properties:
>> 
>> java.util.logging.SimpleFormatter.format = "%4$s: %5$s [%1$tc]%n"
>> 
>> The log messages included quotes that weren't found in the result 
>> predicted by the SimpleFormatter documentation. When I removed the
>> quotes from the line I've just quoted, the messages came out the way
>> they were supposed to. 
>> 
>> In other words, it appears that the quotes shown in the Javadoc don't
>> belong there. Should I be filing a Bugzilla for that so that Oracle
>> can fix the documentation? Or is there a different procedure to
>> follow? 
>> 
>> Of course, someone may have already filed a report for this small
>> error; I haven't checked yet. And maybe this error is so small and
>> obvious that anyone would figure it out as quickly as I did.
>> 
> Read up on Properties, especially
> http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load
> (java.io.Reader). 
> 
> Quotes aren't special as far as Properties is concerned. How special
> they are depends on what does the "load" and eventually uses the
> values (RHS of the key=value pair). More often than not a quote does
> have special meaning there, and you might end up either double-quoting
> in the properties file or doing some more quoting in the client code.
> But if a quote isn't special to a particular user, then it'll just be
> another character.
> 
> It's not small and obvious, no. This kind of documentation error
> presumably has frustrated a fair few people. I don't know why the
> SimpleFormatter documentors made that mistake; they likely didn't
> understand Properties either.
> 
As errors go, this one wasn't very frustrating. The use of quotes seemed 
a bit dubious from the first moment but I gave the Javadoc the benefit of 
the doubt and coded with the quotes. But when I got superfluous quotes in 
the output, I simply tried again with the quotes omitted and got the 
result I'd expected to see.

> You could *check* Bugzilla to see if it's already noted.
>
I just checked and there's no previous report of this error. I expect 
most people who encountered it figured it out in about 30 seconds and 
couldn't be bothered to go through the rigamarole of reporting it ;-) 

I'll put it on my "To Do" list as something to do when I get a bit more 
time. 
 
> Lesson learned: supposedly authoritative documentation has its fair
> share of errors, some much worse than what you just encountered.
> 

I'm sure this error is small potatoes compared to some that have occurred 
over the years ;-) 

I just wanted to get a sense of whether this was too trivial to even 
bother reporting. I'm getting the impression that my basic philosophy 
should be that no error is too trivial to report..... 

-- 
Novice

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

SimpleFormatter Question Novice <novice@example..com> - 2012-03-10 01:40 +0000
  Re: SimpleFormatter Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-09 21:14 -0500
    Re: SimpleFormatter Question Novice <novice@example..com> - 2012-03-10 04:45 +0000
      Re: SimpleFormatter Question Novice <novice@example..com> - 2012-03-10 04:57 +0000
        Re: SimpleFormatter Question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-03-10 09:26 -0400
          Re: SimpleFormatter Question Novice <novice@example..com> - 2012-03-10 17:55 +0000
            Re: SimpleFormatter Question Lew <noone@lewscanon.com> - 2012-03-10 10:27 -0800
              Re: SimpleFormatter Question Novice <novice@example..com> - 2012-03-10 20:47 +0000
        Re: SimpleFormatter Question Arne Vajhøj <arne@vajhoej.dk> - 2012-03-10 12:08 -0500

csiph-web