Home » Java » Core Java

Core Java

Customized Internationalization (i18n) in Java

Internationalization (i18n) is very important in our software projects. It brings mainly these benefits: Externalizing UI strings into external files other than code files and so easy-to-manage UI content. Supporting multiple languages. In this post, a brief practical example of i18n will be given for Eclipse and Java projects, including customizing i18n mechanism to have more maintainable and encapsulated approach. First, ...

Read More »

Java 7: WatchService

Of all the new features in Java 7, one of the more interesting is the WatchService, adding the capability to watch a directory for changes. The WatchService maps directly to the native file event notification mechanism, if available. If a native event notification mechanism is not available, then the default implementation will use polling. As a result, the responsiveness, ordering ...

Read More »

Is Java’s String Class a God Object?

In October I wrote a blog entitled Top Trumps in God Objects where I talked about the discovery of an object I’d found with 167 disparate methods that linked this object with all other parts of the application and, as you’d expect, followed the general criteria for a God or Monster Object. It was recently pointed out to me that ...

Read More »

Investigating the HashDoS issue

Nearly one month ago I have written some thoughts on how the HashDoS problem presented at the 28C3 or other code defects could perhaps be fixed temporarily without interaction of vendors. Now it’s time to deeper investigate the complexity attack and have at look at the sources. I quitely assume that java.util.HashMap and java.util.Hashtable are the most common used data ...

Read More »

Virtualizing Your Java Applications: Best Practices (JavaOne 2011)

Justin Murray started his presentation [“Virtualizing Your Java Applications: Best Practices” (21860)] about five minutes early and began by saying that virtualization has arrived at the point where people no longer need to be concerned about taking advantage of virtualization. He said his presentation is about a year old and is the work of a team of people. The relatively ...

Read More »

Patching Java at runtime

This article will slightly highlight how to fix issues with third party libs that can’t be circumvented are difficult to exclude/bypass/replaced simply provide no bugfix In such cases solving the issue remains a challengig task. As a motivation for this scenario consider the attacks on “hash indexed” data structures, such as java.util.Hashtable and java.util.HashMap (for those who are not familar ...

Read More »

Apache Commons Lang StringUtils

So, thought it’d be good to talk about another Java library that I like. It’s been around for a while and is not perhaps the most exciting library, but it is very very useful. I probably make use of it daily. org.apache.commons.lang.StringUtils StringUtils is part of Apache Commons Lang (http://commons.apache.org/lang/), and as the name suggest it provides some nice utilities ...

Read More »