Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Novice Newsgroups: comp.lang.java.programmer Subject: Re: SimpleFormatter Question Date: Sat, 10 Mar 2012 17:55:54 +0000 (UTC) Organization: Your Company Lines: 69 Message-ID: References: <4f5ab90d$0$289$14726298@news.sunsite.dk> NNTP-Posting-Host: aorhoX7wqL+zg222N4gRzA.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org User-Agent: Xnews/5.04.25 X-Antivirus-Status: Clean X-Notice: Filtered by postfilter v. 0.8.2 X-Antivirus: avast! (VPS 120310-1, 2012-03-10), Outbound message Xref: csiph.com comp.lang.java.programmer:12846 Arved Sandstrom 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