Null is just something you need to deal with in Java. This post looks at the mechanism for handling chained method calls without causing a NullPointerException.
This post uses Java 8.
Miscellaneous Computer Code
Null is just something you need to deal with in Java. This post looks at the mechanism for handling chained method calls without causing a NullPointerException.
This post uses Java 8.
I wanted to benchmark KλudJe's equals/hashCode implementation against common alternatives. I used JMH 1.2 to measure performance.
This post describes a way to implement the equals hashCode and toString methods with relative brevity using Java 8 and KλudJe.
Many of the links on this blog useful for Windows internationalization are dead as Microsoft has ceased hosting them. Some of the information may still be available here.
The last couple of posts have covered how to handle exceptions with Java 8 functional interfaces. This post discusses how to handle arbitrary functional interfaces as of KλudJe 0.2.
The last post discussed exception handling with KλudJe in broad terms. This post presents a more practical example with the Stream type and I/O.
This post describes an approach to handling checked exceptions using Java 8 lambdas without adding try/catch blocks everywhere.
Simple line graph demo code.
Software should tell a good story about its errors. Failure to do this in complex applications can lead to hours or days of trying to puzzle out the cause of some seemingly random exception in the production logs.
Here are some tips for writing Java code that generates informative stack traces.
Sonatype provide the means and instructions to promote open source software to Maven central. I opted to refactor a small library from a previous post on JSON and publish it as a library called jsonunicode.
Here's a small example demonstrating how to convert JSON to XML using JAXB data binding. You might want to use this over streaming where you want to operate on objects in an intermediary step. It is possible to perform the reverse operation but that is not demonstrated here.
I thought I'd take a look at IBM's Java 8 beta multitenancy support. This is a mechanism for sharing runtime resources across Java virtual machine instances. See developerWorks' "Introduction to Java multitenancy."
I installed ibm-java-sdk-ea-8.0-0.0-x86_64-archive3.bin on Linux using a CentOS-6.4-x86_64-LiveCD.iso based host.
This post is a follow-up to HOWTO: script WebSphere AS 8.5.5 internet install and describes the post-install steps to create a development workspace.
The clean install described in the previous post requires further configuration before you can start the server and deploy applications.
This post describes how to perform a scripted install of a WebSphere Application Server (WAS) development environment from the internet. This is adequate if you want automated installation that will be repeated infrequently. Prior knowledge of WAS, Eclipse and Linux is assumed.
IBM has at least three offerings for basic Java EE development:
The scripts described here install the first two options with IDE tooling and Java 7. Eclipse Juno is the latest release with this level of WDT support.
Formally, the following are installed:
I didn't set out to write a MongoDB driver; it came about while I was trying to write proof-of-concept code for my Java binary protocol API. The MongoDB wire protocol just happened to be well documented and easy to implement.
Caveats:
This post is informational; not a tutorial. Everything presented here is pre-alpha code.
The H key stopped working on a Toshiba Equium A110-233 - an obsolete but until now reliable laptop. This was a problem as H was in the power-on password. Notes on the Equium:
This post re-implements the "did you mean..?" spell checker from an earlier post using the new Stream type in Java 8.
The JDK 8 Developer Preview came out recently so I thought I would take a look at the API enhancements. This post demonstrates how refactoring to utilize the new types can change code.
This post refers to JDK build 1.8.0-ea-b106. IntelliJ IDEA has good Java 8 syntax support.
Go (golang.org) has pretty good Unicode support on the Windows command line. I've written about Unicode and cmd.exe before in the context of C++, C# and Java.
Versions: Windows 7 (64-bit); go1.1.1 windows/amd64; Java 1.7.0_21
JSON documents are generally encoded using UTF-8 but the format also supports four other encoding forms. This post covers the mechanics of character encoding detection for JSON parsers that don't provide handling for them - for example, Gson and JSON.simple.
EDIT: 2014; a version of this library has been published to Maven central.