Category Archives: Java

LocalDate in Java 8

The java.time.LocalDate class is new in Java 8. Inspired by the Joda Time library, LocalDate represents a date as it might be used from a wall calendar. It is not a singular instant in time like java.util.Date. You might use a LocalDate to represent a birthday, the start of a school year, or an anniversary.… Read More »

Using Jersey (JAX-RS) with Spring

Spring does a great job for what it does — dependency injection, transaction management, database query simplification, and plenty of other things. Jersey, the reference JAX-RS implementation, is also excellent for what it does — it simplifies the creation of RESTful web services by providing a framework for defining resources, accessing them, and creating their… Read More »

Comparison of the Instant and Date Classes

Java 8 has a new java.time package, and one of its new classes is Instant. The best counterpart to this in past platforms is the java.util.Date class. There are a couple notable differences between Date and Instant: Date has very few useful methods, and Instant provides many. Instant provides finer time granularity and a longer timeline. Most… Read More »

Standard Charsets in Java 7

Once in a while I poke my nose through the release notes of new Java releases. It’s not a particularly rewarding activity, but this time I did find something interesting. Oddly enough, it was interesting for what it did NOT say. I was surprised, so I thought you might want to know about a new… Read More »

On Sale Already?

What, already on sale at Amazon? And it’s not even published yet! Java 7 Recipes will release sometime late December 2011.

User error using Java 7 Locale

Yesterday I pushed a blog entry about my experience with the Locale class in Java 7. As I experimented with the class, I discovered a new category enumeration: Locale.Category.DISPLAY Locale.Category.FORMAT I learned some more about the Locale.setDefault methods that indicate a user error on my part. I stated that ResourceBundle is tied to the DISPLAY… Read More »

Bugs in Java 7 Locale or ResourceBundle?

While working on a chapter in an upcoming APress book, I was experimenting with Java 7’s Locale and ResourceBundle classes. Java 7 introduces two new Locale categories: DISPLAY and FORMAT. You can set the default locale for localizable user interface resources independently from the default locale for data Format subclasses. For example, you supposedly can… Read More »

Java 7 Locale Changes

I admit that I haven’t been particularly active in the i18n or Java standards bodies in the last few years. Pardon me, but I had a wild rumpus in a startup for almost 3 years, then joined Yahoo for a couple years, and BAM! … during that time, the Unicode Consortium added emoji, and the… Read More »