RSS

Category Archives: extension

Keep Your (Webmail?) Session Open

If you have a website that keeps expiring your session after a while, and you want to work around that, then try out the SessionAlive extension for Firefox. I find it extremely useful, especially for webmail (such as Microsoft Outlook Web Access).

The extension works OK in Firefox 3.6.

 
Leave a comment

Posted by on 17 February 2010 in extension, firefox, sessionalive, webmail

 

Java Language: Referencing Current Class From Static Context

>Currently, in Java SE 6, to reference the current class from a static context the name of the class is needed. For example:

public class Foo {
public static final valueOf(String s) {
if (s == null) {
return null;
} else if (s.startsWith(Foo.class.getName() + ':')) {
...
} else {
...
}
}
}

However, if this code would be copied to another class, or if the class is renamed, then that code will cause issues, possibly even causing hard-to-find bugs.

Instead it would be nice if the enclosing class could be referenced without using the name. A possible syntax that does not introduce new language keywords could just be:

class

The previous example would then become:

public class Foo {
public static final valueOf(String s) {
if (s == null) {
return null;
} else if (s.startsWith(class.getName() + ':')) {
...
} else {
...
}
}
}

Of course, this construct should also be allowed in non-static code.

One open question is how to deal with inner classes and referencing a certain outer class. I would not mind keeping that out of scope, so the feature only allows referencing the direct enclosing class.

Another issue is subclassing. Would the class statement reference the current class (in case of a non-static context) or the one the method is defined in?

 
Leave a comment

Posted by on 3 September 2009 in class, extension, java, language, this

 

>del.icio.us extension for Firefox 3.0

>Just recently, Firefox 3.0 RC was released.

I use a fair amount of Firefox extensions, including Firebug, YSlow for Firebug and the del.icio.us extension. The latter was not available for Firefox 3.0, until recently: