Busy Week

This week is TeachJava! here at Rice. It’s a Java seminar targeted mainly at high school computer science teachers. It runs from 8:30 to 5, so I’m away from home from shortly before 8 AM until about 5:30. I don’t really get much done right now. I haven’t been able to install anything on my new machine; in fact, I swapped the computers back and am working on my old machine now. The new one works, but there’s nothing on it to work with yet.

So far, the programming exercises have been going very smoothly. I must commend Dr. Cartwright, Dr. Nguyen, Dr. Wong, and the guys working on DrJava for that — they’ve put a lot of effort into this. Since I haven’t had to run around a lot, I’ve actually managed to finish a nice tool that works with Java class and jar files. It scans for classes, methods, and fields with certain access specifiers (public, private, protected, abstract, native, and so on). The command line syntax was inspired by chmod:

PropertyScanner <infile> [<properties> [<properties> [<properties> ...]]]

where

<properties> = c-* | c{+|-}<cflags>
             | m-* | m{+|-}<cflags><mflags>
             | f-* | [f{+|i}<cflags><fflags>

and the flags consist of one or more letters:

<cflags> - class flags: PFSIA (public, final, static, interface, abstract)
<mflags> - method flags: prosfynai (public, private, protected, static,
           final, synchronized, native, abstract, strict)
<fflags> - field flags: prosfvt (public, private, protected, static, final,
           volatile, transient)

If a certain flag is not set to either + or -, then it does not matter if the corresponding access specifier is present. If, however, a flag is set to +, then the access specifier must be present, and if it is set to -, it must not be present. If {c|m|f}-* is used, then no output at all is generated for classes, methods, or fields, respectively.

So, for example, PropertyScanner Test.class would output all classes, methods, and fields in Test.class. PropertyScanner rt.jar c-* f-* m+Fny m-As would output only native synchronized (+ny) and non-static (-s) methods that are in final (+F), non-abstract (-A) classes in rt.jar. The tool is pretty useful in finding special cases inside rt.jar.

I’ve also started working on the instrumentation strategy to convert non-native synchronized (static) methods to unsynchronized (static) methods containing a synchronized block that uses this (or this.getClass() for static methdos) as lock.

I really need to work on my Rice MBS presentation for Friday, though. I’ve edited the web page, but I still need to update the presentations and get everything into a coherent form. Since I’ve presented related material both at SIGCSE 2004 and OOPSLA 2004, there is a bit of an overlap.

I really wanted to finish doing that today, but a friend and I got dinner together. He mentioned an idea he’d had, I mentioned one I just had, and off we went to a five-hour brainstorming session. I’m not going to disclose here what we talked about, but this brainstorming was probably the most successful session I’ve ever had. We were blurting out ideas so quickly, neither of us could write them down fast enough. I wish we had just voice-recorded it.

Ok, now it’s off to bed for me. Only four hours of sleep again :-S

Share

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in Concurrent Unit Testing, Research, Uncategorized. Bookmark the permalink.

Leave a Reply