29582351c3
The20
29582351c3
The20
@29582351c3
The following code throws an exception. Can you tell why? (I know why, and frankly i think it's absurd.)
http://pastebin.com/PTGrAZAP
Edit: moved code to pastebin.
I think l is for date conversions.
It's a suffix for date time conversion, see
here.
But that's not the point. The point is there are two things fundamentally wrong with this:
First of all the compiler could parse the code for those problems and report them.
Second printf should not throw an exception because of such a trifle. It should report an error and try to parse the value that should be displayed at this point trough a default method or display a string indicating it can't, but to kill the entire program because of this* is ridiculous.
* Since printf doesn't require to be try-catch'ed this is quiet possible.
It's giving you exactly what is wrong in the stack trace. It's an unknown format conversion. Besides that, there is nothing stopping you from catching the exception if you want too. It is just an unchecked exception. Normally I would think someone would use an assertion that the type to be parsed is the correct type and if not to not do it and save an error log.
try{
long l = 0L;
System.out.printf("l = &#xld;", l)
}catch(UnknownFormatConversionException e){
System.err.println(e.getStackTrace())
}
System.out.println("Banana boat")
Even if i catch those errors (so far i caught whatever the compiler complained about being thrown and this isn't thrown according to the method declaration, so the compiler doesn't care, which means many people will never even notice it) it still kills printf (and, unless i catch every single line in a program, a whole lot of other stuff) because of an error that could be reported before the executables are even created.
In related news, Gaias parser doesn't like the combination percent-L. Doesn't seem to have a problem with percent-U, though. At least it doesn't crash the parser, imagine how the site would look if it did ...
Gabriel Faust
nouveau sereph
It's $720RRP in Australia, when I get it I'm putting up a sign at work for $500 o.n.o.
I'm so used to the obo abbreviation that I thought you did an emoticon.
But I know most of the people hear (minus Bento) have no emotions, only an emotional implant emulating fear at change and anticipation of shiny.
I could throw in some angst and maybe some depression if you like.