New ConcJUnit Annotations and Method Name Suffixes

I guess I should mention that I changed the ConcJUnit annotations (@Test) and method name suffixes (testFoo_NOJOIN) a little bit.

I had noticed that putting a _NOJOIN suffix on a test method or using a @Test(forceThreadJoin=false) annotation entirely disabled the test thread group. That’s not really what I wanted to happen, and even if it had been, it was badly named.

Instead of having this conflated behavior, I now have three different flags that can be set. The @Test annotation member has also been renamed.

_NOTHREADS or @Test(checkThreads=false)
Disables the test thread group; now ConcJUnit behaves like JUnit and ignores failures in threads other than the main thread.
_NOJOIN or @Test(checkJoin=false)
Disables the check if threads are still alive.
_NOLUCKY or @Test(checkLucky=false)
Disables the check if threads ended, but only due to lucky circumstances.

Setting checkThreads=false also disables the join and lucky checks; setting checkJoin=false also disables the lucky checks. These changes have been made in the 20091020 release.

I should build Javadocs and include them in DrJava as well. The latest development release has the ConcJUnit 20091020 library that corresponds to JUnit 4.7, but the included API Javadoc is still JUnit 4.4. That is kind of messed up. (Update: Done.)

Share
Posted in Uncategorized | 2 Comments

Print This Post Print This Post  

New Version of DrJava with Mint

I just made a new release of the all-in-one DrJava with Mint:

drjava-r5121-mint-r14186.jar

On the Mint side, there is only one small change: Previously, the Mint compiler only appeared in the “Compiler” drop-down box if the “Display all compiler versions” preference was enabled, which by default was not the case.

Happy experimentation with Mint!

(Re-posted from The Java Mint Blog)

Share
Posted in Mint | Leave a comment

Print This Post Print This Post  

Today’s Loose Ends

I’m in the process of wrapping up today’syesterday’s loose ends:

And now it’s officially tomorrowtoday.

Share
Posted in Concurrent Unit Testing, Mint, Research | Leave a comment

Print This Post Print This Post  

Two Confusing Errors

A while ago, I was told by our one-and-only client of Mint that the version of DrJava with Mint does not display Mint as a compiler, even though it is included in the jar file and therefore should be available. I couldn’t reproduce this, so I set it aside for a while.

Yesterday I realized that there was a logic problem with the “show all compiler versions” preference in DrJava. By default, it is disabled, and that means that DrJava will only show the “best” compiler of each major Java version: Only one Java 6 compiler is shown, and in our notion of “best”, all Java 6 compilers (Sun, Apple, OpenJDK) are “better” than Mint. This was done to avoid using Mint as the default compiler. As a result, if “show all compiler versions” is disabled, Mint is never shown.

I rewrote the logic for this preference to treat compilers from different versions separately, but in doing so, I ran into a very confusing problem: My changes to JavaVersion.FullVersion didn’t seem to “stick”. I’d make changes to the plt.jar library, compile it, copy the plt.jar file into DrJava’s lib directory, rebuild DrJava, but still get the old behavior. I eventually resorted to writing the code in a much more complicated way that didn’t involve changing plt.jar.

On my bike commute to work today I realized what the problem was: The ConcJUnit jar that I started linking with DrJava a while ago included its own version of JavaVersion.FullVersion, and I wasn’t rebuilding ConcJUnit! So what I needed to do is create a ConcJUnit that doesn’t include dependencies like the plt library. One of our other DrJava developers, Dan Smith, had of course long realized that and included such a “jar-base” target for his libraries… Smart!

Because of the explosion of ConcJUnit distributables, I have decided to only make the most important ones available. Right now, that is a version corresponding to JUnit 3.8.2, and one corresponding to JUnit 4.7. The 4.x versions in between won’t be released by default anymore.

The files released are:

concjunitrt.jar
The processor for the runtime environment (necessary to emit “lucky” warnings).
concutest-junit-version-src.jar
The source code.
concutest-junit-version.jar
The stand-alone binary, without the runtime processor (concjunitrt.jar), but with all required dependencies.
concutest-junit-version-withrt.jar
The stand-alone binary with the runtime processor and all required binaries.
concutest-junit-version-withrt-nodep.jar
The binary with the runtime processor but without dependencies (namely the plt.jar file).

I’ll make a new ConcJUnit release soon, and also create a new DrJava with Mint jar file.

Share
Posted in Concurrent Unit Testing, DrJava, Mint, Ramblings | Leave a comment

Print This Post Print This Post  

More Artificially Complex Problem Spaces

At the Rice Computer Science Affiliates Meeting, I just listened to an interesting talk by Keith Cooper about the PACE (platform-aware compilation environment) project.

Keith mainly talked about resource and configuration detection, e.g. detecting cache sizes and alignment. Moshe Vardi commented that it was “a high-tech solution to a low-tech problem” that could be solved with some configuration files. Keith replied that his group didn’t write the rules of the game, and that they had to conform to the grant requirements.

This seems somewhat similar to the comment I made in my last post, that I was, in my work, exploring an artificially complex problem space instead of finding something that is intrinsically true. The result of my work is often interesting hacking, but the value of it is dependent on the longevity and ubiquity of the platform.

Update

Keith contacted me to point out that I have misunderstood the problem. The goal of this stage of the PACE project is not merely to detect hardware properties, like the number of registers, but to determine values that impact program performance, like the number of live values a procedure can use before performance degrades. Those values are dependent both on hardware and software (e.g. compiler and operating system).

Share
Posted in Ramblings | Leave a comment

Print This Post Print This Post  

AWT Exception Handler Cannot Be Reset After Exception

When testing ConcJUnit some more from inside DrJava, I noticed some weird behavior. I had a JUnit 3.8.2 version of a test, and an equivalent JUnit 4 version. Run independently, they behaved as expected (which in my line of work usually means the tests failed), but if I ran them in sequence, then the second test didn’t catch certain errors.

After some experimentation, I found out that it was a problem with the AWT exception handler. The AWT EventDispatchThread class caches the name of the AWT exception handler class the first time an uncaught exception occurs in the event thread; therefore, even when the sun.awt.exception.handler Java property is changed, the same handler will continue to be invoked. Here’s the code from EventDispatchThread:

private static final String handlerPropName = "sun.awt.exception.handler";
private static String handlerClassName = null;
private static String NO_HANDLER = new String();
// ...
private boolean handleException(Throwable thrown) {

try {

if (handlerClassName == NO_HANDLER) {
return false; /* Already tried, and failed */
}

/* Look up the class name */
if (handlerClassName == null) {
handlerClassName = ((String) AccessController.doPrivileged(
new GetPropertyAction(handlerPropName)));
if (handlerClassName == null) {
handlerClassName = NO_HANDLER; /* Do not try this again */
return false;
}
}
// ...

ConcJUnit used different handler classes for JUnit 3-style and 4-style tests, and if a JUnit 3-style test first caused an uncaught exception, a subsequent JUnit 4-style test would not get notified of uncaught exceptions, and vice versa. Now I’m just using one handler, and it “works”.

This still has further implications, though:

  1. If the sun.awt.exception.handler uncaught exception handler property is set and an uncaught exception happens before ConcJUnit can set it, then uncaught exceptions may be missed.
  2. Code that expects to be able to set the sun.awt.exception.handler property cannot be tested correctly with ConcJUnit, because ConcJUnit relies on setting it first.

There are ways around these issues. For example, to circumvent the second problem, ConcJUnit can set the property and immediately cause an uncaught exception in the event thread itself. That way, its own handler is sure to be installed. This handler could then continue to monitor the sun.awt.exception.handler property, and if it changes, delegate to that handler instead of recording an uncaught exception. The first problem isn’t really one if ConcJUnit is used properly.

I won’t implement these improvements, though, unless I notice they are necessary.

This caching behavior, however, showed me two things again: First, it feels like I’m often exploring an artificially complicated problem (Java) space in my research, not something that is intrinsically true. Second, this really is a hack (and Sun says so). I know why Sun implemented the caching, namely to minimize reflection costs, but I don’t think it was done well. Sun really should have cached the class and the class name, and when the class name differs from the Java property, then the class lookup using reflection should have been re-done.

I don’t think this caching behavior is documented anywhere except in the source.

Share
Posted in Concurrent Unit Testing, Ramblings, Uncategorized | Leave a comment

Print This Post Print This Post  

And the Annoying Twit of the Month Award Goes to…

And the annoying twit of the month award goes to… this guy, a student at the Ozarks Technical Community College, for his truly legendary effort of generating 38 support emails to us without considering that the problem might be in his own code.

Over the course of just two days, he managed to open five bug reports, the last one, World revolving around me. . ., definitely out of spite. It even involved a thinly veiled threat of badmouthing our product, DrJava. And to be even more annoying, he kept resetting our priority and resolution fields on the tracker to super urgent. And I even installed Windows Vista for him!

And what was the problem? No incompatibility with Vista, no bug in DrJava. When he finally sent his files (on Chris Warrington’s request — thanks), it turned out he was using a modified version of the Georgia Tech multimedia library, and those (probably self-made) modifications happened to cause an infinite recursion. Is anyone surprised he always blew the stack?

He was creating an infinite recursion in his own program. He could have just look at the stack trace:

...
at SimplePicture.getPixel(SimplePicture.java:323)
at SimplePicture.setAllPixelsToAColor(SimplePicture.java:189)
at SimplePicture.(SimplePicture.java:88)
at SimplePicture.(SimplePicture.java:60)
at Pixel.(Pixel.java:36)
at SimplePicture.getPixel(SimplePicture.java:323)
...

In SimplePicture.getPixel method, line 323, he is calling the Pixel constructor. Pixel extends SimplePicture, so when Pixel‘s constructor (line 36) gets called, it first calls the constructor of the superclass, namely the SimplePicture constructor.

The SimplePicture constructor in line 60 calls first delegates to another SimplePicture constructor, and that second SimplePicture constructor calls the setAllPixelsToAColor method in line 88.

Finally, in line 189, setAllPixelsToAColor calls SimplePicture.getPixel, and the whole thing starts over again.

Hopefully he will not file another bug report or discuss this issue any further on our bug tracker. Instead, he should refer his professor to this analysis of his own programming bug and let the professor help him understand his own mistake.

Closed for good. Hopefully.

Share
Posted in DrJava, Ramblings | 2 Comments

Print This Post Print This Post  

Confusing Hudson Test Failure

After moving our Hudson server to a new server, we started to experience a very confusing test failure in the Java Language Levels module.

The test that failed was AdvancedLevelTest.testShouldBeErrors. It compiles the files in javalanglevels/testFiles/forAdvancedLevelTest/shouldBreak/ and makes sure that they all convert with errors.

I had tried to figure out what causes this, since we haven’t changed the code base, but I failed to see the connection. Here is a summary of the facts:

  • The test failed on denmark.cs on the local partition.
  • The test passed on denmark.cs on the network file system.
  • The test passed on finland.cs on the network file system.
  • The test passed on finland.cs on the /local partition.

From all I can tell, the software (JDK, Ant, JavaCC, etc.) we are using on denmark.cs and finland.cs is the same. It definitely is the same when I switch on denmark.cs from /local to ~.

In the end, it turned out to be a badly written test. It didn’t create a new LanguageLevelConverter for each file to be converted, so the (expected) errors from a previous conversion counted towards the errors of following conversions. There were three files that converted without errors.

For some reason, the order in which the files in javalanglevels/testFiles/forAdvancedLevelTest/shouldBreak/ are enumerated and compiled differs on denmark’s local file system. On denmark’s local file system, one of those files that converts without error is processed first, letting the test fail. On other systems, the three tests aren’t processed until later, and the test succeeds even though it shouldn’t.

I fixed the test, but I don’t know the JLL well enough to decide if this is just a problem with the test, or if there is something wrong with the converter.

This was a very confusing, almost mysterious test failure. It was made so hard to figure out by the combination of a badly written test and the unexpected difference in file enumeration order. The latter really should not matter, but the flaw in the test case made it significant.

There’s still no version 1.328 at this time that fixes the mail configuration bug (issues #4586 and #4596), but other than that, Hudson seems to be fully operational on denmark.cs now.

Update

Hudson 1.328 is available now, and I have already updated.

Share
Posted in DrJava, Ramblings | Leave a comment

Print This Post Print This Post  

DrJava’s Most Annoying Bug is Sun’s JVM Bug

Corky just notified me that the very pesky ArrayIndexOutofBoundsException in DrJava that has been reported in numerous bug reports (assigned to be duplicates of the first report, 2831821: Caret updating is broken) is actually a JVM bug, not a bug in DrJava:

This is a documented bug in Java 6 which is supposed be fixed very soon in a new JVM release. (Update 16 build 2 is supposed to fix it but Update 16 build 1 is the current JDK release.)

See http://bugs.sun.com/view_bug.do?bug_id=6828938 and http://bugs.sun.com/view_bug.do?bug_id=6857057.

In my experience, it does not adversely affect the behavior of Drjava so I ignore it. It happens often on Linux with the Plastic look-and-feel.

The exception trace we have been seeing had no DrJava code in it:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 8
	at sun.font.FontDesignMetrics.charsWidth(FontDesignMetrics.java:492)
	at javax.swing.text.Utilities.getTabbedTextOffset(Utilities.java:381)
	at javax.swing.text.Utilities.getTabbedTextOffset(Utilities.java:302)
	at javax.swing.text.Utilities.getTabbedTextOffset(Utilities.java:286)
	at javax.swing.text.PlainView.viewToModel(PlainView.java:403)
	at javax.swing.text.FieldView.viewToModel(FieldView.java:263)
	at javax.swing.plaf.basic.BasicTextUI$RootView.viewToModel(BasicTextUI.java:1540)
	at javax.swing.plaf.basic.BasicTextUI.viewToModel(BasicTextUI.java:1089)
	at javax.swing.text.DefaultCaret.moveCaret(DefaultCaret.java:311)
	at javax.swing.text.DefaultCaret.mouseDragged(DefaultCaret.java:565)
	at java.awt.AWTEventMulticaster.mouseDragged(AWTEventMulticaster.java:303)
	at java.awt.Component.processMouseMotionEvent(Component.java:6285)
	at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3285)
	at java.awt.Component.processEvent(Component.java:6006)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4604)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4434)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4255)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2475)
	at java.awt.Component.dispatchEvent(Component.java:4434)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

The bug description says:

The test GlyphView2021 mis-uses the parameters `pos’ and `len’ to the GlyphView.getBreakWeight method. These parameters are expected to be in font-related units (pixels or whatever), but in the test they are passed as logical offsets into document (i.e., a number of characters). So in 2-nd run an interval passed to getBreakWeight is 12, and the width of two characters is 14. So they don’t fit and there’s no breakpoint in the region.

What a relief, I was starting to get frustrated with this. I hope the next JVM update is released soon.

Share
Posted in DrJava | 1 Comment

Print This Post Print This Post  

String Comparisons for Common Words Are Bad

It has been a long time since the last item went on the code pranger. I’ve pulled my hair out over many things during the last months, but this is the first time in a long while that I slapped my forehead and wanted to run away.

The issue was first discovered by one of our users and submitted as a bug report. Let me first emphasize that this is clearly a bug in our DrJava code base, not in the submitted sample:

public class CompilerErrors {
int shared = 5;
public void sampleMethod() {
int x = 20;
System.out.println("This is sampleMethod. x is " + x);
}

Note in particular that the closing brace is missing, so we would expect something like “} expected” or “reached end of file while parsing”. The user noticed, however, that when he compiled the following file with Java 6, he got an internal DrJava error instead.

The problem is that we are using String messages to pass the compiler errors and exceptions thrown in the compiler, and then we try to separate these two categories again: Compiler errors are displayed in the “Compiler Output” pane, exceptions are reported as an error in the “DrJava Errors” window.

How did we decide to distinguish errors and exceptions? Using a very unstructured string comparison:

if (message != null && (message.indexOf("CompilerError") >= 0)) throw new UnexpectedException(message);

If the word “CompilerError” occurs in the error message, it is treated as exception. Since the position of the “CompilerError” substring isn’t restricted, any silly compiler error in a file named CompilerError.java, or CompilerErrorModel.java, or CompilerErrorModelTest.java, or CompilerErrorPanel.java — all of which exist in the DrJava code base! — will be treated as serious unexpected exception in the compiler.

It is a really bad idea to use common words that could occur in user-generated text, like file names, as a marker for error conditions.

The solution for this problem, of course, was to analyze the structure of the error messages more closely: The class name of the exception, fully qualified as sun.tools.java.CompilerError had to appear as part of the string "Compile exception: sun.tools.java.CompilerError" at the beginning of the message. Spaces are not allowed in Java class names, so this cannot clash with a user generated file name. I changed the conditional above to:

// need to precisely match the CompilerError message, otherwise a file name containing
// "CompilerError" may trigger an UnexpectedException (see bug 2872797)
if (message != null && message.startsWith("Compile exception: sun.tools.java.CompilerError"))
throw new UnexpectedException(message);

Two additional lessons to be learned from this are that we need to run our tests with both Java 5 and Java 6, and that we need to eat our dog food even more: We should compile DrJava inside DrJava.

Fixed as of revision 5105. I have made a new jar available: drjava-weekly-20091006-r5105.jar.

Share
Posted in Code Pranger, DrJava | Leave a comment

Print This Post Print This Post  

Hudson Moved to Denmark

I just migrated our Hudson continuous integration server from my workstation (finland.cs, now a Dell Studio 435 with a 2.66 GHz i7 — thanks Corky!) to denmark.cs, a dedicated server (my former workstation, a Dell Dimension 9200 with a 3 GHz Pentium 4).

The builds now take a bit longer again (currently about 10 minutes instead of less than 5 minutes for the DrJava unit tests), but I can run the builds without draining CPU time from my workstation. Occasionally, finland.cs became difficult to use when the jobs were running. I scheduled the builds for off-peak times when I’m less likely to be at the office (midnight, 6 AM and 6 PM, and weekends), but the change-triggered builds could run at any time.

There are still a few issues: For some reason, the web server isn’t accessible yet from denmark.cs, so automatic Javadoc, Clover, FindBugs and documentation updates fail. The weekly jar job doesn’t work either.

There is also a bug (issues #4586 and #4596) in Hudson that prevents me from properly configuring the email notifications (although they do seem to work already, as the web server failures mentioned above suggest).

All of this should be resolved pretty soon, though. The web server issue is probably trivial (although I don’t know what to do), and new builds of Hudson are released almost every week, and Kohsuke Kawaguchi has already indicated that this will be fixed in the next version, 1.328.

Share
Posted in DrJava, Uncategorized | Leave a comment

Print This Post Print This Post  

All in One File!

After integrating Mint into DrJava last week, we have now made it even simpler to experiment with Mint: You can download a copy of DrJava that already includes the Mint compiler, all in one file:

That means on Windows and Linux, provided you have installed the JDK 6, you can just double-click on the jar file or start it using

java -jar drjava-r5104-mint-r14185.jar

On MacOS, you still need to install Soylatte and X11 as described in the previous post, but you don’t need to set up Mint. Just run it with

java -jar drjava-r5104-mint-r14185.jar

using Soylatte under X11.

This DrJava with Mint jar file doesn’t give you the mintc and mint command line utilities, but you can edit, compile and run Mint programs in DrJava. This is probably the easiest way to experiment with Mint!

Note: We recommend that you disable DrJava’s auto-update feature when using the DrJava with Mint jar file. The auto-update would otherwise download new versions of DrJava without integrated Mint. Please go to Edit -> Preferences, select the Notifications category, and set “Check for new versions?” to “none (disabled)”.

(Re-posted from The Java Mint Blog)

Share
Posted in DrJava, Mint | Leave a comment

Print This Post Print This Post  

Short DrJava Review on SourceForge

Someone wrote on SourceForge about DrJava:

This program is excellent for its’ intended use. Best part is that you can put it on a memory stick and run it.

Thanks! I concur.

Share
Posted in DrJava | Leave a comment

Print This Post Print This Post  

DrJava with Mint Released

The latest releases of DrJava contains a compiler adapter for Mint. That means it is possible to conveniently compile Mint programs in the DrJava IDE.

To experiment with Mint and DrJava, please do the following:

  1. Download DrJava with Mint the JavaMint implementation page. The file will be named drjava-rxxxx-mint-ryyyyy.jar, where xxxx indicates the version of DrJava and yyyyy the version of Java Mint.
  2. MacOS only: Java Mint requires Java 6. If you have a 32-bit Mac for which Apple does not offer Java 6, you can use Soylatte, but that means DrJava needs to be run under Soylatte as well. Soylatte requires X11 to display graphical user interfaces (GUIs).
  1. Change your PATH environment variable so that Soylatte’s java and javac commands are found first. Edit your .bash_profile or .bashrc file and add the following line at the end of the file:
    export PATH=/usr/local/soylatte/bin:$PATH
  2. Install Apple’s X11. You can find it on your MacOS X installation DVD (preferred!). Here are also some links where you may download X11 (not checked by us — if you try any of these, please let us know!):
  1. Start the X11 application. A terminal window should open. Put the cursor in that terminal window — you will start DrJava from there.
  1. Start DrJava using
    java -jar drjava-rxxxx-mint-ryyyyy.jar

    (in the terminal window on MacOS and Linux; on Windows, you can double-click on the drjava-rxxxx-mint-ryyyyy.jar file)

  2. Look at the right side of the in the “Compiler Output” pane. There is a drop-down box labeled “Compiler”: Select “Mint 6.0_16-Mint” (or something similar). If you don’t see it in the list, DrJava could not find Mint. Check that you installed Mint correctly.
  3. Open a Mint program (“File/Open” menu or “Open” button)
  4. Compile it (“Tools/Compile All” menu or “Compile” button)
  5. Run it (“Tools/Run Document’s Main Method” menu or “Run” button). The output will be displayed in the “Interactions” pane.

Note that the interpreter in the Interactions pane does not understand Mint. It is just a Java interpreter. Brackets and escapes are only recognized in programs in the Definitions pane (source editor).

(Re-posted from The Java Mint Blog)

Share
Posted in DrJava, Mint | 1 Comment

Print This Post Print This Post  

Goodbye Computer Shopper, Hello Esquire?

Please be advised that Computer Shopper magazine has ceased publication after the April 2009 issue.
[…] Special arrangements have been made with Esquire magazine to service your subscription for its full remaining term. You will receive three issues of Esquire for every issue remaining on your Computer Shopper subscription.

(Emphasis in bold mine)

Cripes, I’m going to receive “Esquire” until January 2014! So far, “Esquire” looks like “Maxim”, but with manlier, more mature cologne samples.

The other magazine that I received today was “The Bent”. Now that’s a quality publication ;-)

Share
Posted in Ramblings | Leave a comment

Print This Post Print This Post  

DrJava Mint Branch Merged Back into Trunk

I just merged the trunk-mint branch of DrJava back into the trunk and made a new weekly release (@ I actually issue these “weakly” releases more often than just weekly. It’s just a convenient mechanism to benefit from the auto-update feature. @): drjava-weekly-20090929-r5094.jar.

Share
Posted in DrJava, Mint | Leave a comment

Print This Post Print This Post  

Musings about Facebook Application Privacy

After reading the ACLU’s report about Facebook app privacy problems and taking the quiz demonstrating them, What Do Quizzes Really Know About You?, I was a little upset at first.

The privacy settings just seemed completely insane. Let’s use one’s sexual orientation as (spicy) example and assume we have two facebook users, A and B, with the following privacy settings:

A does not allow apps to see A’s sexual orientation.
A does allow all other accesses.
B does allow all accesses.

If B now runs an application, it would seem like B’s application shouldn’t see A’s sexual orientation, because A denies applications that piece of information. However, it seems like Facebook uses B’s privacy settings, which grant all accesses. The result is that B’s application can see A’s sexual orientation. This seems wrong.

I’ve realized, though, that in principle there is nothing wrong with this. Since B can see A’s sexual status, B’s application could ask B to manually enter it, and the application would still know about it. The desire to apply A’s privacy settings to B’s applications really only prevent automation, not the spread of information.

I would still like Facebook to change this, but if I really want to maintain my privacy, I probably have to abstain from using Facebook at all: The least fixpoint of entities that have my information is not small at all.

PS: Now I am going to post this on Facebook.

Share
Posted in Ramblings | Leave a comment

Print This Post Print This Post  

OpenJDK Compatibility for ConcJUnit

I just made a new ConcJUnit release available on SourceForge: version 20090927.

While working on integrating Mint into DrJava, I tested it on Mac. Since Mint requires Java 6, that involved using Soylatte, and Soylatte is based on OpenJDK. To my surprise, Mint did not work in DrJava. Upon investigation, this was only the case when ConcJUnit’s “lucky” warnings were also enabled.

So the problem wasn’t actually in Mint, it was in ConcJUnit. I even made a note about this incompatibility.

The problem is some missing method in the Float class:

Error occurred during initialization of VM
java.lang.UnsatisfiedLinkError: java.lang.Float.floatToIntBits(F)I
        at java.lang.Float.floatToIntBits(Native Method)
        at java.lang.Math.(Math.java:801)
        at edu.rice.cs.cunit.concJUnit.ThreadSets.addThreadStarted(ThreadSets.java:24)
        at java.lang.Thread.start(Thread.java:593)
        at java.lang.ref.Reference.(Reference.java:145)

I don’t quite know what is going on here, but I circumvented this issue by not using the Math class. I just had to write my own Math.min method.

Share
Posted in Concurrent Unit Testing | Leave a comment

Print This Post Print This Post  

Running Mint Programs in DrJava

I have now managed to hack DrJava and Mint together. I still have to improve the source, because right now a few things are hard-coded, but it is a working proof-of-concept.

Welcome to DrJava.  Working directory is C:\Program Files\JavaMint\langtools\mintTest
> java edu.rice.cs.mint.runtime.Mint Power_For
131072.0
> 

This is the output for the Mint program

import edu.rice.cs.mint.runtime.Code;
public class Power_For {
public static void main(String[] args) {
final double x = 2;
int n = 17;

Code c = <| 1.0 |>;
for(int i=0; i;
}

System.out.println(c.run());
}
}

It is a bit inconvenient because you have to invoke the Mint launcher, edu.rice.cs.mint.runtime.Mint, but that can be changed too.

The last problem that I had was the class path when the compiler is invoked at runtime. It took some time to understand that, because instead of saying something like “Class not found”, the error message was “Variable not found”. But because the compiler didn’t find a class definition for a certain symbol, it assumed the symbol had to be a variable.

More information later.

Share
Posted in DrJava, Mint | Leave a comment

Print This Post Print This Post  

Installing JavaMint on Linux

Here are some quick instructions on how to download and install Java Mint.

Linux

  1. You need Sun’s JDK 6 installed.
  2. Download the “binaries only” Java Mint zip file from the Java Mint implementation page. In this example, I have saved the file in my home directory, i.e. at /home/mgricken.
  3. Open a console.
  4. Change into the /usr/local directory:
    cd /usr/local
  5. Unzip it as root. This means you have to type in your password:
    sudo unzip /home/mgricken/JavaMint-r13871-binaries.zip
  6. Set the MINT_HOME and PATH environment variables:
    export MINT_HOME=/usr/local/JavaMint
    export PATH=$PATH:$MINT_HOME/langtools/bin
  7. To make this permanent, edit your .bash_profile or .bashrc file and put the two lines from step 6 line at the end of the file.

Now you can compile programs using mintc and run them using mint.

mintc Power.java
mint Power

There are samples in the /usr/local/JavaMint/langtools/mintTest directory. You cannot compile them there, however, because the directory is read-only unless you are the root user. So unzip the Java Mint implementation zip file somewhere else, e.g. in /home/mgricken/JavaMint.

(Re-posted from The Java Mint Blog)

Share
Posted in Mint | Leave a comment

Print This Post Print This Post