JOpt Simple 4.5 released
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
This release incorporates a couple of smaller features.
Happy parsing!
Brainwaves on the brink of awryness. (Challenge.)
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
This release incorporates a couple of smaller features.
Happy parsing!
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
This release incorporates a number of smaller features and bug fixes, many of which were originated by...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
This release incorporates a number of smaller features and bug fixes, many of which were originated by...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
This release incorporates a small API change to produce a list of OptionSpecs that correspond to the...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
This release incorporates a small API change to allow compile-time arrays as the supplier of default values...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
I'm pleased to have received community contributions since moving the project to GitHub. This release incorporates...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here.
I'm pleased to have received community contributions since moving the project to GitHub. This release incorporates...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here. Happy parsing!
One of the things about JOpt Simple about which I feel most proud is the fact that I advertise alternatives to it on the project's website. I realize that choices abound for command line option parsing in Java; before...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here. Happy parsing!
Repo is here. I didn't carry previous CVS history with me. Currently toying with the idea of allowing alternative help formatters for a next release. Will move website at some point also.
By now you surely know that Java's generics info is erased from objects during compilation. For example, given an object whose runtime class is java.util.List, I cannot tell at runtime whether the object was originally a List<Integer>, or a List<String>,...
Save the date: Feb 25 2011, in Houston, the AgileDotNet conference. Lots of great speakers and topics -- this is a high value-for-dollar event. Sign up before Dec 1 2010 with the discount code EARLYBIRD and get a good...
QuickCheck is a neat Haskell tool for specifying properties that should hold for functions and firing lots of random inputs into those functions to test that the properties hold true. JUnit's answer to such...
Go check it out! I appreciate any and all constructive feedback.
Changes are here. Biggest change is to admit sources of property configuration other than Properties and string-to-string Maps. Enjoy!
Eager to implement some extra goodies for Property Binder's next release. Enjoy!
This will likely be the last release candidate of Property Binder before declaring 2.0 final. Changes are here.
I've also moved the source to GitHub.
Eager to hear your constructive feedback. Enjoy!
Property Binder is my Java library for providing typed access to entries in properties files. It offers such access by allowing a programmer to provide it a Java interface whose methods represent the keys of the properties file. The...
Property Binder is a Java library that provides typed access to entries in properties files. It offers such access by allowing a programmer to provide it a Java interface whose methods represent the keys of the properties file. The...
Nearly ten years ago, I wrote an article exploring how to find a method on a Java class using reflection, given the class's name, the method name, and an array of arguments, whose parameter types would be most compatible...
Often when I go to run a JUnit test from Eclipse via a context menu on the test class from the Package Explorer, I find myself looking for the "Run as JUnit Test" item under "Team..." rather than...
import java.lang.reflect.Modifier;
public interface X {
interface Y { /* ... */ }
}
interactive> Modifier.isPublic(X.Y.class.getModifiers())
true
Y is implicitly public, apparently -- just like methods and fields on X would be.
If you're going to use both java.text.DateFormat
s and Joda Time DateTimeFormatter
s, be confident that the time zone data of both the JDK and Joda agree (they are different physical sources). Otherwise, you could end up up with...
Checkstyle is a fantastic tool to help Java development teams keep code clean and unsurprising. The feedback it gives should be treated as suggestions from a trusted advisor, not a nuisance. If I write a method that's getting a...
JOpt Simple is my Java library for parsing command-line options. For 3.2, I've added the ability to specify a set of default values for arguments of a given option. Hopefully this will alleviate the burden of checking...
Just had an article published on DevX's Java Zone. PICA stands for Proxied Interfaces Configured with Annotations. Enjoy!
No, it's not.
JUnit ships with an "experimental" custom runner called Enclosed
. When you annotate a test class as @RunWith(Enclosed.class)
, it builds a test suite consisting not just of tests from the annotated class, but of every nested inner class of...
JOpt Simple is my Java library for parsing command line options. You can find the changes in this latest release here. Happy parsing!
JOpt Simple is my Java library for parsing command-line options. Version 3.1 adds the ability to convert arguments of options to Java types via converter objects. These are useful for types that do not meet the requirements of JOpt Simple is my Java library for parsing command-line options. Release 3.0.1 has no new features, but fixes a dependency problem for Maven users, so that by declaring a Maven dependency on jopt-simple, you don't end up pulling...
Via email from Mark Reinhold, Principal Engineer at Sun Microsystems -- it appears that JOpt Simple is being used for some of the command line tools in the OpenJDK: "I thought you might be interested to...
JOpt Simple is my Java library for parsing command-line options. For 3.0-rc2, I've overhauled the example page quite a bit, so that hopefully the capabilities of the library and the option syntax it supports are clearer. I welcome all...
JOpt Simple is my Java library for parsing command-line options. Release 3.0 will abandon support for pre-Java-5 JDKs, in favor of the new more typesafe ways of retrieving arguments of command line options. I will continue to support the...
JOpt Simple is my Java library for parsing command-line options. Release 3.0 will abandon support for pre-Java-5 JDKs, in favor of the new more typesafe ways of retrieving arguments of command line options. I will continue to support the...
It's all real-world programming. JOptSimple is my Java library for parsing command line options. Release 2.4.1 fixes a bug with the new help screen generation changes. Thanks to Hans Dockter for reporting it. As usual, download instructions are available at the project's website. JOpt Simple is my Java library for parsing command-line options. Release 2.4 sports some bug fixes, internal reorganization, some new features such as option synonymy and a cleaned-up help printing facility. JOpt Simple seems to be generating more interest...
Jumble is a pretty neat tool for doing mutation testing on your Java code, to see how effective your JUnit tests are at catching small changes to the test subjects. It works by mutating bytecode rather than source...
The latest snapshots of Jaggregate seem to work well with BGGA closures converted to functors and predicates. I had to extract one-method interfaces from the abstract *Function and *Predicate classes (the interfaces are "*Functor" and "*Condition") -- they...
Yay! "The Layperson's Guide to Building a Better User Experience" -- in short, you are a user experience designer; take interaction design, user experience, and user personae seriously; and read up. "Semantic Web for the Working Ontologist" -- Interesting discussion from...
"Using FindBugs in Anger", with the great Bill Pugh -- nice summary of a great tool. I liked the slide listing some common (but incorrect) wisdom about bugs and static analysis: programmers are smart, and smart programmers don't make dumb...
Some random thoughts from Day 1 of JavaOne 2008 (belated): Wi-Fi connections spotty at best. Kind of disappointing they couldn't handle the traffic they could have reasonably expected. "JRuby: What, Why, How...Do It Now!" -- Nice JRuby overview. An admonishment...
On Day One, I picked Josh Bloch's brain for a bit about whether the BGGA closures proposal was redeemable if the gnarlier bits might be removed, leaving it basically with function types. It was cool to mingle with the Java...
I'm at JavaOne this year, my first trip to the big dance. Based on the rock-concert lines forming for the first General Session, I'd say the conference is doing pretty damn well. Flight into SFO from DFW last night...
My colleague Rod presented me with the following (paraphrased): The question arose: What if an implementor doesn't have a meaningful value to return? JOpt Simple is a Java library for parsing command line options, supporting GNU getopt_long() and POSIX getopt(). See the changes here. Releases of JOpt Simple are synced with the central Maven repository as of version 2.3.6. See how...
Don't let your Scrum go stale. At work, "No roadblocks" had become not just the answer to the third Scrum question, but almost a sort of punctuation to let the team know that the current pig is done speaking...
I attended CITCON North America in Denver this weekend. I went to last year's North American offering in Dallas/Fort Worth (my turf) and had a great time, learned a lot, and met some really smart, passionate software professionals. Second...
I've taken to pronouncing the Java generics wildcard character as "huh?". So that: is pronounced "List of huh? extends Comparable of huh?". I've also been doing the equivalent of finger-quoting when pronouncing these expressions, doing angle brackets...
What with all the hubbub about Erlang, I've started diving into functional programming languages. Back in school, I learned a bit of Scheme as part of a mostly-Pascal-based second-semester CS course -- just before Scheme became the language...
...static methods? It's common practice in Java projects to use an interface as a dumping ground for related constants. Back in the pre-1.5 days, developers did this in order that client classes could implement the interface and gain unqualified access...
Jaggregate is a generics-aware Java collections library that is modeled after the ANSI Smalltalk collection protocols. Having this bug fixed would make certain Jaggregate factory methods a lot handier, allowing type inference to work its magic. If you've ever written Java code that uses reflection, you've surely been confronted with what to do in case a reflected If you're a programmer faced with the prospect of maintaining an existing system, and if "code is your house and you have to live in it", then for goodness's sake do a walk-through, do an inspection before moving in....
Another debate about the 'final' keyword in Java forges ahead on JavaLobby. Certainly classes and methods marked 'final' impede efforts to test in isolation (via mocking) classes that collaborate with such classes. We all know to declare class-level...
Herewith, some patterns of online communication that, in my opinion, have jumped the shark. I'm excluding the obvious targets that are emoticons, ubiquitous abbreviations (LOL, etc.)...these are a bit more geek-oriented. Checkstyle brought a nostalgic smile to my face this morning: C:\java\scratchpad\src\main\pholser\beans\JavaBeanTestCase.java:110:35: '3' is a magic number. JOpt Simple is a Java library for parsing command line options, supporting GNU getopt_long() and POSIX getopt(). See the changes here. JOpt Simple is a Java library for parsing command line options, supporting GNU getopt_long() and POSIX getopt(). See the changes here. I will soon follow up this release with a 2.2 that basically just removes all the deprecated...
JOpt Simple is a Java library for parsing command line options, supporting GNU getopt_long() and POSIX getopt(). See the changes here. Jaggregate is a generics-aware collections library that is modeled after the ANSI Smalltalk collection protocol. See the changes here. Jaggregate is a generics-aware collections library that is modeled after the ANSI Smalltalk collection protocol. See the changes here. Rest assured that if closures are to become part of the core Java language, Jaggregate will support...
"A foolish consistency is the hobgoblin of little minds." I haven't read the essay, so I'm not sure whether in it Emerson tries to explain the difference between foolish and wise consistency. So, at the...
The recent draft proposal to add special syntax for local and anonymous functions in Java 7 has gotten me really excited. If this stuff becomes part of the core language, my Jaggregate library will leap to support these typed functions...
I've really enjoyed reading Ivan Moore's Programming in the Small series. Lots of really nifty observations on how to improve your code a little bit at a time. My favorite quote thus far: Another "programming in the small" style...
In a previous post, I discussed what appeared to be my project partners' mild apprehension about using helpful CppUnit assertions like You'll never go hungry feeding on the mistakes of others. Doing so, however, is like eating at McDonald's every day -- it's just not good for you. 1. Concrete classes, where appropriate, will have static factory methods that leverage generic type inference. These will be named such that they read well when statically imported. So, for example, instead of: you...
I recently started a C++ project at work. I hadn't done any serious C++ programming since 1998, so this was a great chance to shake off the rust. The project had been underway for some weeks when I joined. I...
At work recently I found myself trying to improve the execution time of a JavaScript routine that processed bits of text in chunks of a few characters each. The text was stored as a JavaScript Array. To process the text...
My profuse, sincere apologies to the three people that read this thing; I've been pretty busy these past few months. 8^) I intend to commit to cyberspace some thoughts that have been accumulating during that time; among the topics are: Jaggregate is a Java-5-only collections library that is modeled after the ANSI Smalltalk collection protocols. See the changes here. Also, please welcome Binkley as a developer on the Jaggregate project. Jaggregate is a Java-5-only collections library that is modeled after the ANSI Smalltalk collection protocols. Changes can be found here. As with the analogous Jaggregate, my Java-5-only Smalltalk-ish collections library, has collections that support the Java collections' notions of I cooked up a toy Java 5 class that generates warnings of the "unchecked" family when compiled: Part of the contract of Reads up to In this entry, I aim to illustrate some of the issues that developers may encounter as they migrate their existing JUnit 3.x test suites to JUnit 4. For this illustration, we'll migrate the tests for Jaggregate, a Java-5-only...
Dave Astels recently wrote about encapsulation violation. It's a helpful reminder of some OO basics that are all too easy to forget, especially for those of us who came from a procedural programming background. In my early career,...
The inspirational man behind the inspirational book The Road Less Traveled has died. World's a little darker for me today. JOpt Simple is my simple, test-driven command line options parser library for Java. It aims to support the rules of POSIX getopt() and GNU getopt_long(). There are plenty of libraries that perform this task, but I think you'll find...
Seen this morning in the slow crawl down the freeway to get to work this morning: a shiny white BMW 5-series number, creeping along like the rest of us, with a vanity plate that read "ZIP N BY". JOpt Simple is my simple, test-driven command line options parser library for Java. It aims to support the rules of POSIX getopt() and GNU getopt_long(). There are plenty of libraries that perform this task, but I think you'll find...
I worry about the "commoditization of agile methods." In previous consulting gigs, I heard lots of buzz about "Agile" as though "Agile" were a software development process itself. Heck, we fell prey to such thinking within our own organization: "Let's...
Jaggregate is a Java 5 collections library that is inspired by the ANSI Smalltalk collection protocols. There are probably some generics relaxations that can happen in subsequent releases, plus predicate algebra, read/write streams....Please have a look, I'd love to...
A colleague introduced me to a terrific game called Set. Like most great games, it contains simple elements that combine to create a compelling play experience. The game consists of eighty-one (3^4) cards. Each unique card has one, two or...
Jaggregate is my attempt at implementing a Smalltalk-ish collections library in Java 5. I'd have been interested to see what Nutmeg looked like back in the day; but I can't find it anywhere on the web...the Thought Inc....
Go ahead, SpellThingsOut, instead of abbrvtngLkCrzy. It is a ternary conditional operator, as in "composed of three or arranged in threes", as in having three operands; not tertiary, as in "third in place, order, degree, or rank." (Thank you, Dictionary.com.) Whilst working on Jaggregate, I ran into some surprises involving Java generics (shocking, no?). Today's subject: turning a generic collection into an array. The uppermost interface in Jaggregate's type hierarchy is Collection<E>. We might wish to ask such a...
Sometimes we create Java classes that consist of static methods and constants only, usually to group related stateless utility routines, a la java.lang.Math. We typically prevent the client of the class from instantiating the class by making the class's zero-argument...
A committee at Lake Superior State University in Michigan publishes a list of overused words and phrases every year. On this year's list are "battleground state," "...and I approve this message," and "carbs," among others. It got me...
JOpt Simple is my crack at command line option parsing. It is the offical version of my "getopts" TDD experiment. I implemented it TDD-style, and it felt great. Realistically, the software is beta-quality, but I need to get...
Anyone else catch a glimpse on the Fox World Series broadcast of Jimmy Fallon, formerly of "Saturday Night Live", celebrating on the field with the Red Sox after they clinched? Possibly mugging down with some woman? Was it for Kinda nice how the last Cardinal retired in the 2004 World Series, Edgar Renteria, wore the uniform number -- 3 -- of the Bambino himself, perpetrator of the alleged 86-year-long "Curse", broken at long last. Good show, Red Sox. ...than a Yankees/Red Sox American League Championship Series? The greatness unfolds beginning tonight. The underdog rooter in me (I stuck with my beloved Buffalo Bills through four straight Super Bowl losses; exulted at Luis Gonzalez' series-winning base hit in 2001)...
Every software developer who's tired of being called a "resource," raise your hand. I can scarcely think of a more dehumanizing way to label someone that you'd like to think was hired because of their intelligence, creativity, and motivation in...
I got sucked into an installment of Donald Trump's show "The Apprentice" on CNBC last night. In that installment, Bradford, a star member of the losing team who had been granted an exemption from getting fired, was so convinced that...
Binkley writes about extending JUnit in order to preserve the original cause of test failure in the presence of tearDown() throwing exceptions. If you want to preserve the cause of the tearDown() failure, use this slight modification of...
More genius from the Pragmatic Programmers. My previous employer had a lot of racehorses they were trying to herd... ...as opposed to what? "Junior Software Architect"? "Software-Architect-in-training"? "Software Architect Apprentice"? "Wanna-be-a-Software-Architect-When-I-Grow-Up"? All this is to say nothing of the very blurry notion of the purpose, duties, and capabilities of a software architect. At minimum, I would think most would...
The great John Taylor Gatto, former New York State and City Teacher of the Year, has produced a scathing indictment of forced public schooling, bringing to light the many players behind the scenes and framing some of the boredom,...
An article I wrote about the use of anonymous inner classes with instance initializers to create Java collections concisely for JUnit testing is cited in the forthcoming Manning book "JUnit Recipes: Practical Methods for Programmer Testing". Many...
Nice article here. Interestingly enough, when doing my getopts TDD experiment, I decided to make OptionException -- the superclass of all exceptions raised by the library -- a RuntimeException rather than a checked exception. The rationale? You're probably...
The conventional wisdom on handling exceptions says never to catch big-E Exception. However, often there are legitimate reasons for treating uniformly any exception that might be thrown from within a try block: you may really want to handle any such...
There are a lot of libraries out there that perform the functions of POSIX/GNU getopt()/getopt_long() for Java: Jakarta Commons CLI, JArgs, GNU Getopt transliterated to Java...many of them with some fairly gnarly code in their innards. I'm...
Chris Stevenson rants about C# enums here. I thought I'd share some of my own observations about C# enums, from earlier in 2003, previously shared only amongst co-workers. Ostensibly enums are a way to define a type such that...
The past twenty years have brought us all manner of new programming languages, many of which feature lots of reserved words and cartoon-curse-word punctuation, all in the name of making our programming tasks easier, or putting more power into the...
Amongst the gaggle of mock object frameworks for Java, I had come to prefer EasyMock over Mock Objects, as it's rather minimal (no pre-generated mocks for J2EE interfaces), and has the extra "cool factor" of generating mocks at...
Rough draft up and running here. I finally realized that, with the writings I wanted to share and a bit of spare time on vacation, I might as well publish this stuff on server space I'm already paying for....
Thanks Armen, I'm just glad to be here...I'll give 110%, take it one post at a time, etc.JOpt Simple 3.0.1 released
JOpt Simple incorporated into OpenJDK
JOpt Simple 3.0-rc2 released
JOpt Simple 3.0-rc1 released
JOpt Simple 3.0-beta1 released
Profiteroles, huh?
Read More
JOpt Simple 2.4.1 released
JOpt Simple 2.4 released
Writing an Ant task for Jumble mutation tester
Let jQuery rock your world
Jaggregate with BGGA closures
Props for JOptSimple
JavaOne 2008, Day 4
JavaOne 2008, Day 3
JavaOne 2008, Day 2
JavaOne 2008 -- Day 1 preview
public interface Executable<T> { T execute(); }
JOpt Simple 2.4-beta1 released
No roadblocks.
CITCON North America 2008 in Denver
Pronouncing wildcarded Java generics expressions
List<? extends Comparable<?>>
Jaggregate 3.2 released
Method
or Constructor
raises an IllegalAccessException
when invoke()
d. How do you test your code's reaction to IllegalAccessException
? Do you...
Due diligence for maintenance programmers
Java 'final' "in anger"
Played-out online geek bits
Cute reminder from Checkstyle
JOpt Simple 2.2 released
JOpt Simple 2.1 released
JOpt Simple 2.1 beta 1 released
Jaggregate 3.0 released
Jaggregate 3.0 beta 1 released
Foolish consistency?
-- Ralph Waldo Emerson, "Self-Reliance"Jaggregate and Java 7 closures
Programming in the small
It wasn't so much about sticking with the chopsticks...
CPPUNIT_ASSERT_EQUAL()
, and preferring to stick with the very raw, way less helpful Asserter::failIf()
. Turns out it wasn't...
To the hypercritic
What's coming in Jaggregate 3.0
Dictionary<String, Integer> lengths = new Dictionary<String, Integer>();
We'll stick with the chopsticks, thanks...
Back in the blogging saddle...
Jaggregate 2.0 released
Jaggregate 2.0 beta 2 released
Altering "varargs" (remove|retain)AllKeys in Jaggregate
jaggregate.Collection
methods, I've modified the removeAllKeys( K... )
and retainAllKeys( K... )
methods to have parameter list ( K[] )
, and added overloads that have parameter list ( K, K... )
, to avoid big...
Altering "varargs" (add|remove|retain)All methods in Jaggregate
addAll()
, removeAll()
, and retainAll()
. For usability's sake, there are three overloads of each: void addAll( jaggregate.Collection<? extends E> others );...
package pholser.util; import java.util.Arrays; public class Stack<T> { private final Object[] storage; private int top; public Stack() { this.storage = new Object[...
java.io.InputStream.read(byte[] b, int off, int len)
reads:len
bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len
bytes, but a...
Converting Tests from JUnit 3.x to JUnit 4, Part 1
Illustrations of encapsulation violation (-ation, -ation, ...)
/Requiescat in pace/, Scott Peck
JOpt Simple 1.0 released
Funny highway circumstances
JOpt Simple 1.0 beta 1 released
Agile with a capital "A"
Jaggregate 1.0 released
Jaggregate 1.0 beta 1 released
Creating an array from a generic Java collection
Nice idiom for uninstantiable Java classes
My Nerd Score
Tech catch phrases that beat me down
Launching new Java OSS projects
Fallon on the field at Busch?
Beautiful baseball poetry
Does sport get any more delicious?...
Attention all software development "resources"!
Tweaking JUnit test running behavior
An NUnit equivalent for JUnit's TestCase?
using NUnit.Framework; namespace Pholser { [TestFixture] public abstract class AbstractTestFixture { [TestFixtureSetUp] protected virtual void FixtureTearDown() { } [SetUp] protected virtual void SetUp() { } [TearDown] protected virtual void TearDown() { } [TestFixtureTearDown] protected virtual void FixtureTearDown() { } }...
The Underground History of American Education
Article cited in "JUnit Recipes"
Decision diagrams for Java exception handling
Oh, for nicer Java exception handling...
getopt in Java, TDD-style
More C# 'enum' Wackiness
What's So Bad About Smalltalk?
You Choose To Mock Me...
Piecing Together My Web Site
It's Alive! It's Alive!