Java, Software Development

Java 9 Stream filter, takeWhile, dropWhile methods

This post demonstrates how to use the new methods – takeWhile and dropWhile – of the Stream interface in Java 9 Jigsaw. We’ll touch briefly on Stream.filter(Predicate p) just to get comfortable before trying out the new methods.

Read More...

Java, Software Development

Java Compare Multidimensional Arrays Of Reference Types

This post shows how to compare two multidimensional arrays of reference types in Java. The codes will examine if they are the same in terms of element values and their

Read More...

Java, Software Development

Avoid NullPointerException with Stream.ofNullable in Java 9

This post demonstrates how to avoid NullPointerException in Java 9 when working with Stream and using the overloaded of metho

Read More...

Java, Software Development

Very Slow XML Validation against XSDs with unique and key elements

This post demonstrates that XML validation against XSDs with is very very very slow especially for very huge list of elements, e.g., 300,000 items. We are better off ensuring distinct values through codes.

Read More...

Java, Software Development

Java, XSLT, and XML with Namespaces

When a XML uses namespaces, they need to be declared and used in the .xsl file so that the javax.xml.transform.Transformer knows how to deal with various elements in the XML. This post demonstrates how to deal with namespaces when performing transformation from or on XMLs.

Read More...

Java, Software Development

Convenient Way to override equals(), hashCode(), and toString() methods

Two years ago, I used to override the equals() and hashCode() methods via Eclipse’s “Generate hashCode() and equals()…” feature. It proved to be a maintenance nightmare. Every time a new field is added to a class, these methods are updated to include the new instance variable. There is a convenient way to override these methods, toString() included. One that’ll not require subsequent changes when fields are added or remove from a class.

Read More...

Java, Software Development, Spring

Spring – Configurable Default Value for @Value

This post demonstrates how to use @Value that has both a configurable default value and a hard-coded final fallback value.

Read More...

Java, Software Development, Spring

Spring MVC – How to test for view name

This post briefly demonstrates how to test for a view name in Spring MVC.

Read More...

Docker, Java, Software Development

Java – Deploy Java CLI Application to Docker Image

With Docker, we can create portable Java CLI applications for various environments by pre-building container images. This could make deployment a lot easier and less messy in particularly in Production environments. This post briefly demonstrates how to create a Docker image with a Java CLI application.

Read More...

Java, Software Development

How to get the first and last dates of current quarter using Joda Time

This article demonstrates how come up with the first and last dates of the current quarter.

Read More...