Home » Author Archives: Dustin Marx (page 9)

Author Archives: Dustin Marx

Better JUnit-based Unit Tests with NetBeans 7.4 beta Hints

netbeans-logo

In my last post, I wrote about hints provided in NetBeans 7.4 beta that improve a developer’s ability to avoid nasty runtime issues with Java exception handling. In this post, I look at how two more hints provided by NetBeans 7.4 beta can be used to make unit tests more correct and more clear during unit test execution. These are ...

Read More »

NetBeans 7.4 Beta Hints Warn of Ineffective Exception Handling

netbeans-logo

There are numerous examples of how Java exception handling can be more difficult than it might first appear and Josh Bloch devoted an entire chapter of Effective Java (both editions) to exception handling. The checked exception model in Java remains “controversial.” I was pleased to see that the NetBeans 7.4 beta I recently downloaded has some hints to help with ...

Read More »

Is Java Riskier than C/C++?

software-development-2-logo

Lately, I’ve heard a number of folks discussing whether Java development is riskier than development in C/C++ (from here on out, I’ll just refer to “C”). They’re not rehashing the age-old discussion of which language is best, but are wondering whether teams developing in Java have unique risks compared to teams developing in C. They are particularly interested to learn ...

Read More »

Ant Properties Nuances

apache-ant-logo

Every once in a while, I’m reminded of a few subtle nuances of Ant properties that can, when forgotten, lead to confusion when dealing with Ant. In particular, the fact that Ant properties are generally immutable (not counting local properties as of Ant 1.8) and are set “permanently” upon their first setting can lead to slightly surprising results. The properties ...

Read More »

Groovy Sql and Oracle ‘Invalid column index’ SQLException

groovy-logo

There are some minor potential dangers associated with Groovy’s def keyword. The Groovy style and language feature guidelines for Java developers provides some warnings about use of def. In this blog post, I demonstrate an advantage of being more explicit in typing when using Groovy SQL with an Oracle database to avoid a potential “Invalid column index” SQLException because I’ve ...

Read More »

Escaping XML with Groovy 2.1

groovy-logo

When posting source code to my blog, I often need to convert less than signs (<), and greater than signs (>) to their respective entity references so that they are not confused as HTML tags when the browser renders the output. I have often done this using quick search-and-replace syntax like %s/</\&lt;/g and %s/>/\&gt;/g with vim or Perl. However, Groovy ...

Read More »

Enhanced Groovy-based JAR/Manifest Diff Tool

groovy-logo

This brief blog post provides another Groovy script that provides simple differencing of two JAR (or WAR or EAR) files and their MANIFEST.MF files. It represents a combination of the JAR comparison script I blogged on earlier, Rick‘s addition of Groovy‘s CliBuilder to allow some output data to be turned off, my MANIFEST.MF comparison script, and an ability to use ...

Read More »

Comparing Manifest Files with Groovy

groovy-logo

My last post discussed comparing the high-level contents of two JAR files using a Groovy script and a 2011 post covered displaying a particular JAR file’s manifest file. This post illustrates the combination of those two ideas with an example of comparing the Manifest files of two different JAR files. As illustrated in the just-referenced two blog posts, it is ...

Read More »

Comparing JARs with Groovy

groovy-logo

It can sometimes be useful to compare the contents of two JARs. In this blog post, I demonstrate a Groovy script that acts like a simple “diff” tool for comparing two JAR files. The Groovy script shown here, jarDiff.groovy, can undoubtedly be improved upon, but does perform what I wanted it to. The script compare two provided JARs in the ...

Read More »

Common Red Flags in Java Development

java-logo

In several years of developing, reading, reviewing, and maintaining hundreds of thousands of lines of Java code, I have become accustomed to seeing certain “red flags” in Java code that often (but perhaps not always) imply problems with the code. I’m not talking about practices that are always wrong, but rather am talking about practices that might, in limited circumstances, ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close