Can someone explain what is wrong with java.util.logging framework and why should other logging framework like log4j/logback or slf4j should be prefered?
121255
Is it still worth to add the log4j library to a Java 5 project just to log let's say some exceptions to a file with some nice rollover settings. Or will the standard util.logging facility do the job as well?  What do you think?
35165
I am working on a performance critical multi-threaded application. I looked at rlog, Ace and Boost logging. I chose rlog because I read it was the fastest (when logging is disabled, it has the least overhead).  The problem I have is it shows the file name, line number etc. even in release mode. If you can tell me how to shut that information off, my problem might be solved. In any case what is the most efficient logger in C++ for my situation?
915
How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:
47950
Why don't more mainstream statically typed languages support function/method overloading by return type?  I can't think of any that do.  It seems no less useful or reasonable than supporting overload by parameter type.  How come it's so much less popular?
85933
I was writing a toString() for a class in Java the other day by manually writing out each element of the class to a String and it occurred to me that using reflection it might be possible to create a generic toString() method that could work on ALL classes. I.E. it would figure out the field names and values and send them out to a String.  Getting the field names is fairly simple, here is what a co-worker came up with:  public static List initFieldArray(String className) throws ClassNotFoundException {      Class c = Class.forName(className);     Field field[] = c.getFields();     List&lt;String&gt; classFields = new ArrayList(field.length);      for (int i = 0; i &lt; field.length; i++) {         String cf = field[i].toString();         classFields.add(cf.substring(cf.lastIndexOf(".") + 1));     }      return classFields; }   Using a factory I could reduce the performance overhead by storing the fields once, the first time the toString() is called. However finding the values could be a lot more expensive.  Due to the performance of reflection this may be more hypothetical then practical. But I am interested in the idea of reflection and how I can use it to improve my everyday programming.
118382
I have used ogr2ogr to import various formats to PostgreSQL and have used GDAL utilities. Is there a complete Java port for these tools or are they simply wrappers calling JNI to C++ code?   I have seen some Java stuff by Googling but not sure how much are they current and kept up to date.
33769
I haven't had the chance to take any serious low-level programming courses in school. (I know I really should get going on learning the "behind-the-scenes" to be a better programmer.) I appreciate the conveniences of Java, including the ability to stick anything into a System.out.print statement. However, is there any reason why you would want to use System.out.printf instead?   Also, should I avoid print calls like this in "real applications"?  It's probably better to  to print messages to the client's display using some kind of UI function, right?
6108
Why do I get compiler errors with this Java code?  1  public List&lt;? extends Foo&gt; getFoos() 2  { 3    List&lt;? extends Foo&gt; foos = new ArrayList&lt;? extends Foo&gt;(); 4    foos.add(new SubFoo()); 5    return foos; 6  }  Where 'SubFoo' is a concrete class that implements Foo, and Foo is an interface.  Errors I get with this code:   On Line 3: "Cannot instantiate ArrayList&lt;? extends Foo&gt;" On Line 4: "The method add(capture#1-of ? extends Foo) in the type List&lt;capture#1-of ? extends Foo&gt; is not applicable for the arguments (SubFoo)"   Update: Thanks to Jeff C, I can change Line 3 to say "new ArrayList&lt;Foo&gt;();".  But I'm still having the issue with Line 4.
43053
Following a lot of people's advice, I am trying to use Mavensmate. Coming from developer console, there are still things I am not used to. One thing is I can't find where the debug log is. I tried everything I can think of under Mavensmate > debugging, but it seems to just processing for a while and then tell me it is a pass - but where is the log?   I assume that the debug log is not auto-generated like in developer console - so need to generate either a quick or debug log before opening it. Is that correct?
95949
I was told this a few times in this very site, but I wanted to make sure this is really the case.  I was expecting to be able to sprinkle NSLog function calls throughout my code, and that Xcode/gcc would automatically strip those calls out when building my Release/Distribution builds.  Should I avoid using this? If so, what alternatives are most common between experienced Objective-C programmers?
88324
Usually I use tail -f /var/log/messages to get updates if there are new lines.  How to have the similar functionality for journalctl?
17717
I wish to print a Stack&lt;Integer&gt; object as nicely as the Eclipse debugger does (i.e. [1,2,3...]) but printing it with out = "output:" + stack doesn't return this nice result.  Just to clarify, I'm talking about Java's built-in collection so I can't override its toString().  How can I get a nice printable version of the stack?
92031
Whats this syntax useful for :       function(String... args)   Is this same as writing       function(String[] args)    with difference only while invoking this method or is there any other feature involved with it ?
7798
According to the , 3rd edition:        I wish to understand why this decision has been made. What's wrong with generic exceptions?  (As far as I know, generics are simply compile-time syntactic sugar, and they will be translated to Object anyway in the .class files, so effectively declaring a generic class is as if everything in it was an Object. Please correct me if I'm wrong.)
49214
We work heavily with serialization and having to specify Serializable tag on every object we use is kind of a burden. Especially when it's a 3rd-party class that we can't really change.  The question is: since Serializable is an empty interface and Java provides robust serialization once you add  implements Serializable - why didn't they make everything serializable and that's it?    What am I missing?
117501
Yesterday I was having a heated debate with a coworker on what would be the preferred error reporting method. Mainly we were discussing the usage of exceptions or error codes for reporting errors between application layers or modules.  What rules do you use to decide if you throw exceptions or return error codes for error reporting?
37195
How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.  Other alternative could be like manually including the line number when printing to the log. Is there any other way?