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


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

Re: SimpleFormatter Question

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: SimpleFormatter Question
References <XnsA011D2474C732jpnasty@94.75.214.39> <4f5ab90d$0$289$14726298@news.sunsite.dk> <XnsA011F1BB1A949jpnasty@94.75.214.39> <XnsA011F3BCFD12Ajpnasty@94.75.214.39>
Message-ID <YDI6r.12585$wf.1272@newsfe09.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2012-03-10 09:26 -0400

Show all headers | View raw


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.

You could *check* Bugzilla to see if it's already noted.

Lesson learned: supposedly authoritative documentation has its fair
share of errors, some much worse than what you just encountered.

AHS

-- 
Last week I helped my friend stay put. It's a lot easier'n helpin' 'em
move. I just went over to his house and made sure that he did not start
to load shit into a truck.
-- Mitch Hedberg

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