Skip to main content

Posts

GWT Custom Event Handler

Can someone give me an example of creating a custom set of an Event and a Handler. Say you have a Person object that you want your widgets to know if it got updated. You create a HandlerManager and now you have to create an Event and a Handler. How would you define those classes so that you can subscribe and fire events? Most of the Events are DOM based, while I want to create some custom events and handlers that I can fire outside of any browser-based event.

Https Connection Android

I am doing a https post and I'm getting an exception of ssl exception Not trusted server certificate. If i do normal http it is working perfectly fine. Do I have to accept the server certificate somehow?

Modifying final fields in Java

Let's start with a simple test case: import java.lang.reflect.Field; public class Test { private final int primitiveInt = 42; private final Integer wrappedInt = 42; private final String stringValue = "42"; public int getPrimitiveInt() { return this.primitiveInt; } public int getWrappedInt() { return this.wrappedInt; } public String getStringValue() { return this.stringValue; } public void changeField(String name, Object value) throws IllegalAccessException, NoSuchFieldException { Field field = Test.class.getDeclaredField(name); field.setAccessible(true); field.set(this, value); System.out.println("reflection: " + name + " = " + field.get(this)); } public static void main(String[] args) throws IllegalAccessException, NoSuchFieldException { Test test = new Test(); test.changeField("primitiveInt", 84); System.out.println("direct: primitiveInt = " + test.getPrimitiveInt()); test.

Is it good practice to use java.lang.String.intern()?

The Javadoc about String.intern() doesn't give much detail. (In a nutshell: It returns a canonical representation of the string, allowing interned strings to be compared using == ) When would I use this function in favor to String.equals() ? Are there side effects not mentioned in the Javadoc, i.e. more or less optimization by the JIT compiler? Are there further uses of String.intern() ?

Find Oracle JDBC driver in Maven repository

I want to add the oracle jdbc driver to my project as dependency (runtime scope) - ojdbc14. In MVNrepository site the dependency to put in the POM is: <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.3.0</version> </dependency> of course this does't work as it is not in the central repository used by maven. 2 questions: How do I find a repository (if any) that contains this artifact? How do I add it so that Maven will use it?

Are there some good and modern alternatives to Javadoc?

Let's face it: You don't need to be a designer to see that default Javadoc looks ugly . There are some resources on the web which offer re-styled Javadoc. But the default behaviour represents the product and should be as reasonably good-looking. Another problem is the fact that the usability of Javadoc is not up-to-date compared to other similar resources. Especially huge projects are hard to navigate using Firefox's quick search. Practical question: Are there any standalone (desktop) applications which are able to browse existing Javadoc in a more usable way than a browser would? I'm thinking about something like Mono's documentation browser. Theoretical question: Does anyone know, if there some plans to evolve Javadoc, in a somehow-standardized way? EDIT: A useful link to Sun' wiki on this topic .