Rod Waldhoff's Weblog  

< Monday, 7 April 2003 >
Rod's Open Source To Do List #
My open source contributions have been a bit scattershot recently. I do have some overarching goals here, they just happen to touch on a number of independent projects. By way of self-imposed public shaming, here's some open source related tasks I've been meaning to take care of. (These are listed in no particular order, I'll leave it to the reader to sort out the dependencies.)

I've got some other tasks in mind of course, but these are the ones that have been floating around for a while. We'll see if this helps act as a motivator, it should at least be useful for my own reference.

Morgan posted a similiar list a while back (a blog entry that was lost it seems). I'm not sure he found it helpful, but I like the idea of having some modern equivalent of .plan files.

Update: [13 April 2003] I've added unsigned byte, short, unsigned int, long, and float types (and tests of course) to commons-collections over the past few days. I suppose I should add byte and double types for completeness, even though it's counter to the "you aren't gonna need it" spirit. I.e., I've used all the others, but for whatever reason have never encountered a need for ByteList or DoubleList.

Update: [15 April 2003] I've added byte and double types to the primitives package. I've also discovered an interesting artifact of this approach which makes me want to add char based types as well.

Update: [17 April 2003] I've added char types to the primitives package, as well as CharIterator/Reader adapters. I think I can finally call that first bullet code complete.

A Question on Applying the LGPL to Java #
Assume org.gnu.foo is an LPGL'ed Java package. Which of the following can I do without applying the LGPL to my code:

  1. Import and use a type from org.gnu.foo:
    import org.gnu.foo.Bar;
    class ClientCode {
      public static void main(String[] args) {
        Bar bar = new Bar();
        bar.someMethod(args[0]);
      }
      /* ... */
    }
    or
    import org.gnu.foo.Bar;
    class MoreClientCode {
      void clientMethod(Bar bar) {
        bar.someMethod("xyzzy");
      }
      /* ... */
    }
  2. Extend from a type in org.gnu.foo:
    import org.gnu.foo.Bar;
    class ClientCode extends Bar {
      /* ... */
    }
  3. Specialize a type from org.gnu.foo, but via composition rather than inheritance:
    import org.gnu.foo.Bar;
    class ProxyBar {
      ProxyBar(Bar bar) {
        this.bar = bar;
      }
     
      void someMethod(String str) {
        return bar.someMethod(str.toUpperCase());
      }
     
      /* ... */
     
      private Bar bar;
    }
  4. Invoke a method from org.gnu.foo using "hard-coded" reflection:
    class ClientCode {
      public static void main(String[] args) throws Exception {
        Class klass = Class.forName("org.gnu.foo.Bar");
        Method method = klass.getMethod("someMethod", new Class[] { String.class });
        Object obj = klass.newInstance();
        method.invoke(obj,new String[] { args[0] });
      }
    }
  5. Invoke a method from org.gnu.foo using runtime-determined reflection:
    class ClientCode {
      public static void main(String[] args) throws Exception {
        Class klass = Class.forName(args[0]);
        Method method = klass.getMethod(args[1], new Class[] { String.class });
        Object obj = klass.newInstance();
        method.invoke(obj,new String[] { args[2] });
      }
    }
    invoked via
    java ClientCode org.gnu.foo.Bar someMethod xyzzy
  6. Invoke a method from org.gnu.foo as an external process:
    class ClientCode {
      public static void main(String[] args) throws Exception {
        Process p = Runtime.getRuntime().exec("java org.gnu.foo.Bar xzyyz");
        /* ... */
      }
    }

How do these answers change if org.gnu.foo is licensed under the "regular" GPL?