FREE BURMA!

( ? , qUeStIoNMaRk )

Seeking for a sustainable amount of chaos. AKA an electronic stream of consciousness about software engineering, open source, life. By Marco Fabbri.

November 19, 2007

Mixed Feelings

Filed under: life, java, geek, programming

Somewhere in a Java source file

// content does not include the quotes or curly braces around the string!
private String content;
/**
* content includes the quotes or curly braces around the string!
*
* @param content
*/
BibtexString(BibtexFile file, String content) {
super(file);
this.content = content;
}

This code features a self-contradicting couple of comments: “does not include” / “includes” referred to the same object, what can be called a Schroendiger’s String; i.e. until you open the box… hmmm… take a look at the actual code, content is a marvelous data structure able to and not to include the quotes or curly braces around the string at the same time. A look at the actual code, a few lines below, leads to the death of this quantum string, revealing it does not contain the quotes or curly braces around the string.

// is this really a number?
try {
Integer.parseInt(content);
writer.print(content);
} catch (NumberFormatException nfe) {
writer.print('{');
writer.print(content);
writer.print('}');

1 Comment »

The URI to TrackBack this entry is: http://questionmark.blogsome.com/2007/11/19/mixed-feelings/trackback/

  1. HeHeHeHe, maybe Authors of BibText java library have some confused ideas
    :-D

    Comment by Marco Ramilli — November 20, 2007 @ 1:41 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Get free blog up and running in minutes with Blogsome | Theme designs available here