Applying a custom Jackpot rule.
1.1 --- a/openide.util/src/org/openide/util/Mutex.java Wed Jan 18 05:18:08 2006 +0000
1.2 +++ b/openide.util/src/org/openide/util/Mutex.java Wed Jan 18 05:23:05 2006 +0000
1.3 @@ -7,23 +7,19 @@
1.4 * http://www.sun.com/
1.5 *
1.6 * The Original Code is NetBeans. The Initial Developer of the Original
1.7 - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
1.8 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
1.9 * Microsystems, Inc. All Rights Reserved.
1.10 */
1.11 package org.openide.util;
1.12
1.13 -import org.openide.ErrorManager;
1.14 -
1.15 import java.awt.EventQueue;
1.16 -
1.17 import java.lang.reflect.InvocationTargetException;
1.18 -
1.19 import java.util.ArrayList;
1.20 import java.util.HashMap;
1.21 import java.util.LinkedList;
1.22 import java.util.List;
1.23 import java.util.Map;
1.24 -
1.25 +import org.openide.ErrorManager;
1.26
1.27 /** Read-many/write-one lock.
1.28 * Allows control over resources that
1.29 @@ -208,9 +204,7 @@
1.30 try {
1.31 return doEventAccess(action);
1.32 } catch (MutexException e) {
1.33 - InternalError err = new InternalError("Exception from non-Exception Action"); // NOI18N
1.34 - ErrorManager.getDefault().annotate(err, e.getException());
1.35 - throw err;
1.36 + throw (InternalError) new InternalError("Exception from non-Exception Action").initCause(e.getException()); // NOI18N
1.37 }
1.38 }
1.39
1.40 @@ -301,9 +295,7 @@
1.41 try {
1.42 return doEventAccess(action);
1.43 } catch (MutexException e) {
1.44 - InternalError err = new InternalError("Exception from non-Exception Action"); // NOI18N
1.45 - ErrorManager.getDefault().annotate(err, e.getException());
1.46 - throw err;
1.47 + throw (InternalError) new InternalError("Exception from non-Exception Action").initCause(e.getException()); // NOI18N
1.48 }
1.49 }
1.50
2.1 --- a/openide.util/src/org/openide/util/SharedClassObject.java Wed Jan 18 05:18:08 2006 +0000
2.2 +++ b/openide.util/src/org/openide/util/SharedClassObject.java Wed Jan 18 05:23:05 2006 +0000
2.3 @@ -7,26 +7,33 @@
2.4 * http://www.sun.com/
2.5 *
2.6 * The Original Code is NetBeans. The Initial Developer of the Original
2.7 - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
2.8 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
2.9 * Microsystems, Inc. All Rights Reserved.
2.10 */
2.11 +
2.12 package org.openide.util;
2.13
2.14 -import org.openide.ErrorManager;
2.15 -
2.16 -import java.beans.*;
2.17 -
2.18 -import java.io.*;
2.19 -
2.20 +import java.beans.PropertyChangeListener;
2.21 +import java.beans.PropertyChangeSupport;
2.22 +import java.io.Externalizable;
2.23 +import java.io.IOException;
2.24 +import java.io.ObjectInput;
2.25 +import java.io.ObjectInputStream;
2.26 +import java.io.ObjectOutput;
2.27 +import java.io.ObjectOutputStream;
2.28 +import java.io.ObjectStreamException;
2.29 +import java.io.Serializable;
2.30 import java.lang.ref.WeakReference;
2.31 import java.lang.reflect.Method;
2.32 -
2.33 import java.security.AccessController;
2.34 import java.security.PrivilegedActionException;
2.35 import java.security.PrivilegedExceptionAction;
2.36 -
2.37 -import java.util.*;
2.38 -
2.39 +import java.util.HashMap;
2.40 +import java.util.HashSet;
2.41 +import java.util.Map;
2.42 +import java.util.Set;
2.43 +import java.util.WeakHashMap;
2.44 +import org.openide.ErrorManager;
2.45
2.46 /** Shared object that allows different instances of the same class
2.47 * to share common data.
2.48 @@ -875,9 +882,7 @@
2.49 msg = "<unknown object>"; // NOI18N
2.50 }
2.51
2.52 - IllegalStateException ise = new IllegalStateException(msg);
2.53 - err.annotate(ise, invalid);
2.54 - throw ise;
2.55 + throw (IllegalStateException) new IllegalStateException(msg).initCause(invalid);
2.56 }
2.57 // else fine
2.58 }
2.59 @@ -891,16 +896,10 @@
2.60 obj.initialize();
2.61 } catch (Exception e) {
2.62 invalid = e;
2.63 -
2.64 - IllegalStateException ise = new IllegalStateException(invalid.toString() + " from " + obj); // NOI18N
2.65 - err.annotate(ise, invalid);
2.66 - throw ise;
2.67 + throw (IllegalStateException) new IllegalStateException(invalid.toString() + " from " + obj).initCause(invalid); // NOI18N
2.68 } catch (LinkageError e) {
2.69 invalid = e;
2.70 -
2.71 - IllegalStateException ise = new IllegalStateException(invalid.toString() + " from " + obj); // NOI18N
2.72 - err.annotate(ise, invalid);
2.73 - throw ise;
2.74 + throw (IllegalStateException) new IllegalStateException(invalid.toString() + " from " + obj).initCause(invalid); // NOI18N
2.75 } finally {
2.76 initializeInProgress = false;
2.77 }
3.1 --- a/openide.util/src/org/openide/util/WeakListenerImpl.java Wed Jan 18 05:18:08 2006 +0000
3.2 +++ b/openide.util/src/org/openide/util/WeakListenerImpl.java Wed Jan 18 05:23:05 2006 +0000
3.3 @@ -7,26 +7,33 @@
3.4 * http://www.sun.com/
3.5 *
3.6 * The Original Code is NetBeans. The Initial Developer of the Original
3.7 - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun
3.8 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
3.9 * Microsystems, Inc. All Rights Reserved.
3.10 */
3.11 +
3.12 package org.openide.util;
3.13
3.14 -import org.openide.ErrorManager;
3.15 -
3.16 import java.awt.event.FocusEvent;
3.17 import java.awt.event.FocusListener;
3.18 -
3.19 -import java.beans.*;
3.20 -
3.21 -import java.lang.ref.*;
3.22 -import java.lang.reflect.*;
3.23 -
3.24 +import java.beans.PropertyChangeEvent;
3.25 +import java.beans.PropertyChangeListener;
3.26 +import java.beans.PropertyVetoException;
3.27 +import java.beans.VetoableChangeListener;
3.28 +import java.lang.ref.Reference;
3.29 +import java.lang.ref.SoftReference;
3.30 +import java.lang.ref.WeakReference;
3.31 +import java.lang.reflect.Constructor;
3.32 +import java.lang.reflect.InvocationHandler;
3.33 +import java.lang.reflect.Method;
3.34 +import java.lang.reflect.Modifier;
3.35 +import java.lang.reflect.Proxy;
3.36 import java.util.EventListener;
3.37 import java.util.EventObject;
3.38 -
3.39 -import javax.swing.event.*;
3.40 -
3.41 +import javax.swing.event.ChangeEvent;
3.42 +import javax.swing.event.ChangeListener;
3.43 +import javax.swing.event.DocumentEvent;
3.44 +import javax.swing.event.DocumentListener;
3.45 +import org.openide.ErrorManager;
3.46
3.47 /**
3.48 * A listener wrapper that delegates to another listener but hold
3.49 @@ -369,9 +376,7 @@
3.50
3.51 proxy = p;
3.52 } catch (Exception ex) {
3.53 - IllegalStateException e = new IllegalStateException(ex.getMessage());
3.54 - ErrorManager.getDefault().annotate(e, ex);
3.55 - throw e;
3.56 + throw (IllegalStateException) new IllegalStateException(ex.toString()).initCause(ex);
3.57 }
3.58 }
3.59
4.1 --- a/openide.util/src/org/openide/util/io/NbObjectOutputStream.java Wed Jan 18 05:18:08 2006 +0000
4.2 +++ b/openide.util/src/org/openide/util/io/NbObjectOutputStream.java Wed Jan 18 05:23:05 2006 +0000
4.3 @@ -7,21 +7,28 @@
4.4 * http://www.sun.com/
4.5 *
4.6 * The Original Code is NetBeans. The Initial Developer of the Original
4.7 - * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
4.8 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
4.9 * Microsystems, Inc. All Rights Reserved.
4.10 */
4.11 +
4.12 package org.openide.util.io;
4.13
4.14 +import java.awt.Image;
4.15 +import java.io.ByteArrayOutputStream;
4.16 +import java.io.IOException;
4.17 +import java.io.ObjectOutput;
4.18 +import java.io.ObjectOutputStream;
4.19 +import java.io.OutputStream;
4.20 +import java.util.ArrayList;
4.21 +import java.util.HashSet;
4.22 +import java.util.Iterator;
4.23 +import java.util.List;
4.24 +import java.util.Map;
4.25 +import java.util.Set;
4.26 +import java.util.WeakHashMap;
4.27 import org.openide.ErrorManager;
4.28 import org.openide.util.WeakSet;
4.29
4.30 -import java.awt.Image;
4.31 -
4.32 -import java.io.*;
4.33 -
4.34 -import java.util.*;
4.35 -
4.36 -
4.37 // note: keep method NbObjectInputStream.resolveObject
4.38 // consistent with replaceObject method
4.39
4.40 @@ -53,9 +60,7 @@
4.41 try {
4.42 enableReplaceObject(true);
4.43 } catch (SecurityException ex) {
4.44 - IOException ioe = new IOException(ex.toString());
4.45 - ErrorManager.getDefault().annotate(ioe, ex);
4.46 - throw ioe;
4.47 + throw (IOException) new IOException(ex.toString()).initCause(ex);
4.48 }
4.49 }
4.50