Suns Jni comes under OpenSource-License (APL 2.0)

2005-10-20 Thread theUser BL

I have now read at
http://www.heise.de/newsticker/meldung/65143
that Sun wants to put the license of the Jini Technology Starter Kit 2.1 
under the Apache-License 2.0.


You can also read more about it at
http://www.jini.org/

Greatings
theuserbl




___
Classpath mailing list
Classpath@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath


i2p liberated! [Fwd: GCJ support is on the way]

2005-10-20 Thread Mark Wielaard
Hi all,

Sometimes we can use some moral support. So let me share the following
with you all. Normally we are a bit hesitant to recommend people to
just switch since we cannot guarantee that everything just works.
But we are getting better and better. The following email was just sent
to the i2p mailinglist. i2p is an anonymous network (both message and
stream based support). See for more information http://i2p.net/

There were some small bugs (Calendar seems difficult to get all the
corner cases right) and two performance issues (the SecureRandom one
looks nasty, but I know Andrew is looking at the memory use of gcj
native compiled applications already). All in all the transition seemed
to have gone smoothly and as jrandom said:

In any case, this is quite kickass, as it means we'll be able to
both integrate more cleanly with other languages AND ship
whereever
GCJ ships (DFSG friendly!)  Thanks go to the GCJ and GNU
Classpath
folks for their hard work!

Go team!

Mark
---BeginMessage---
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thanks to mjw's prodding, I pulled the latest (4.0.2) gcj last night
and tried my hand at getting I2P up and running under it.  End
result is that overnight, I've had my test network pushing gigs upon
gigs of data with half of the network running under sun's JVM, and
the other half GCJ'ed :)

There were three issues of varying degrees of complexity to get
there though:

* 1) Calendar problems

  The first is a bug in GCJ (or maybe GNU Classpath, haven't tested
  on Jam or Kaffe yet) - when working with a java.util.Calendar, not
  all of the fields were being set correctly when they should be:

  import java.util.*;

  public class t {
public static void main(String args[]) {
  Calendar cal = new GregorianCalendar();
  cal.setTime(new Date());
  cal.set(Calendar.HOUR_OF_DAY, 0);
  cal.set(Calendar.MINUTE, 0);
  cal.set(Calendar.SECOND, 0);
  cal.set(Calendar.MILLISECOND, 0);
  long midnight = cal.getTimeInMillis();
  System.out.println(Midnight:  + midnight);

  cal = new GregorianCalendar();
  cal.setTime(new Date());
  // workaround for fields not set
  cal.set(Calendar.YEAR, cal.get(Calendar.YEAR));
  cal.set(Calendar.DAY_OF_YEAR, cal.get(Calendar.DAY_OF_YEAR));
  // continue as normal
  cal.set(Calendar.HOUR_OF_DAY, 0);
  cal.set(Calendar.MINUTE, 0);
  cal.set(Calendar.SECOND, 0);
  cal.set(Calendar.MILLISECOND, 0);
  midnight = cal.getTimeInMillis();
  System.out.println(Workaround:  + midnight);
}
  }

  Both JVMs (Sun and GCJ) display the workaround properly, and Sun's
  displays the original Midnight: properly, but GCJ's
  cal.getTimeInMillis() returns 0 (the YEAR and DAY_OF_YEAR fields
  are not properly computed).

  There are a few places in I2P's code where we use Calendar in this
  sort of way, but the latest I2P CVS includes workarounds for these
  issues.

* 2) xerces problems

  The xerces we ship with won't compile cleanly under GCJ - it
  complains about missing references to some sun.* functions.  We
  aren't using the latest xerces though, and since mjw told me that
  it should work, I'll grab the latest and give it a go, upgrading
  our CVS xercesImpl.jar if it works (and causes no regressions).
  In any case, xerces isn't technically necessary for I2P operation
  - its only used by Jetty for the router console (a really, really
  useful application, but not technically necessary).

* 3) prng problems

  We gobble random bits like crazy.  To get a functional system, I
  had to disable our PRNG pool (which pulls data out of
  java.security.SecureRandom) and enable the weak PRNG (which pulls
  data out of java.util.Random).  This is not necessarily
  entirely GCJ's fault, but more of an issue with the OS which GCJ
  doesn't hide.

  Shipping with the weak PRNG wouldn't be prudent though, so we'll
  need to go back and revive the Fortuna integration effort before
  shipping GCJ'ed routers.

Overall, this is fantastic news - I'm glad mjw convinced me to give
it another shot.  The I2P SDK, the streaming library, and the client
apps all build fine under GCJ, completely compatible with ones
running on Sun's or IBM's JVM.  I've had a GCJ'ed version of
i2psnark running overnight, doing swarming file transfer with normal
i2p-bt and azneti2p peers without problem.

One of the really interesting things here is how this affects SAM -
with the I2P SDK and streaming libraries built into libi2p.so (or
even libi2p.a), there is no reason why Python/C/C++ apps couldn't
link against those objects and use
net::i2p::client::streaming::I2PSocket directly!  If someone wants
to explore this avenue, it does sound very promising.

A side note regarding GCJ.  I realize everyone always complains that
Java uses up tons of memory, and if only we had native apps it'd
magically allocate out of thin air ;)  Unfortunately, while the
overnight router test 

[cp-patches] FYI: Added missing methods in org.ietf interface declarations.

2005-10-20 Thread Meskauskas Audrius
This patch adds the declaration of the hashCode method to these two 
interfaces. The method is inherited from Object, and explicit 
declaration just indicates that it must be overridden because the 
.equals must be overridden.


2005-10-20  Audrius Meskauskas  [EMAIL PROTECTED]

* org/ietf/jgss/GSSCredential.java (hashCode),
org/ietf/jgss/GSSName.java (hashCode): New declarations.

Index: org/ietf/jgss/GSSCredential.java
===
RCS file: /cvsroot/classpath/classpath/org/ietf/jgss/GSSCredential.java,v
retrieving revision 1.3
diff -u -r1.3 GSSCredential.java
--- org/ietf/jgss/GSSCredential.java2 Jul 2005 20:32:55 -   1.3
+++ org/ietf/jgss/GSSCredential.java20 Oct 2005 08:36:52 -
@@ -331,4 +331,14 @@
* @return True if this object equals the other.
*/
   boolean equals(Object another);
+
+  /**
+   * Return the hash code of this credential. When overriding [EMAIL 
PROTECTED] #equals},
+   * it is necessary to override hashCode() as well.
+   *
+   * @return the hash code that must be the same for two credentials if
+   * [EMAIL PROTECTED] #equals} returns true.
+   */
+  int hashCode();
+
 }
Index: org/ietf/jgss/GSSName.java
===
RCS file: /cvsroot/classpath/classpath/org/ietf/jgss/GSSName.java,v
retrieving revision 1.3
diff -u -r1.3 GSSName.java
--- org/ietf/jgss/GSSName.java  2 Jul 2005 20:32:55 -   1.3
+++ org/ietf/jgss/GSSName.java  20 Oct 2005 08:36:52 -
@@ -201,6 +201,15 @@
   boolean equals(Object another);
 
   /**
+   * Return the hashcode of this GSSName. When overriding [EMAIL PROTECTED] 
#equals},
+   * it is normally necessary to override hashCode() as well.
+   *
+   * @return the hash code that must be the same for two names if [EMAIL 
PROTECTED] #equals}
+   * returns true.
+   */
+  int hashCode();
+
+  /**
* Creates a mechanism name (MN) from an arbitrary internal name.  This
* is equivalent to using the factory methods [EMAIL PROTECTED]
* 
GSSManager#createName(java.lang.String,org.ietf.jgss.Oid,org.ietf.jgss.Oid)}
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] Patch: BasicMenuItemUI fix

2005-10-20 Thread Lillian Angel
This is a fix for JCheckBoxMenuItem's. The state of the menu item was
never changed when the checkbox menu item was selected or deselected.

2005-10-20  Lillian Angel  [EMAIL PROTECTED]

* javax/swing/plaf/basic/BasicMenuItemUI.java:
Added new ItemListener field.
(BasicMenuItemUI): Initialized new field.
(installListeners): Installed new listener.
(removeListeners): Removed new listener.
(MenuDragMouseHandler): Class should be private, not
in API.
(MenuKeyHandler): Likewise.
(PropertyChangeHandler): Likewise.
(ItemHandler): New class implemented to change the
state of the menu item if it is a checkbox menu item.

Index: javax/swing/plaf/basic/BasicMenuItemUI.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java,v
retrieving revision 1.30
diff -u -r1.30 BasicMenuItemUI.java
--- javax/swing/plaf/basic/BasicMenuItemUI.java	18 Oct 2005 22:10:32 -	1.30
+++ javax/swing/plaf/basic/BasicMenuItemUI.java	20 Oct 2005 18:36:33 -
@@ -50,10 +50,13 @@
 import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
 import java.util.ArrayList;
 
 import javax.swing.ButtonModel;
 import javax.swing.Icon;
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JComponent;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
@@ -161,6 +164,11 @@
* PropertyChangeListener to listen for property changes in the menu item
*/
   private PropertyChangeListener propertyChangeListener;
+  
+  /**
+   * ItemListener to listen for item changes in the menu item
+   */
+  private ItemListener itemListener;
 
   /**
* Number of spaces between accelerator and menu item's label.
@@ -181,6 +189,7 @@
 menuDragMouseListener = createMenuDragMouseListener(menuItem);
 menuKeyListener = createMenuKeyListener(menuItem);
 propertyChangeListener = new PropertyChangeHandler();
+itemListener = new ItemHandler();
   }
 
   /**
@@ -431,6 +440,7 @@
 menuItem.addMenuDragMouseListener(menuDragMouseListener);
 menuItem.addMenuKeyListener(menuKeyListener);
 menuItem.addPropertyChangeListener(propertyChangeListener);
+menuItem.addItemListener(itemListener);
   }
 
   /**
@@ -719,6 +729,7 @@
 menuItem.removeMenuDragMouseListener(menuDragMouseListener);
 menuItem.removeMenuKeyListener(menuKeyListener);
 menuItem.removePropertyChangeListener(propertyChangeListener);
+menuItem.removeItemListener(itemListener);
   }
 
   /**
@@ -949,7 +960,7 @@
   /**
* This class handles mouse dragged events.
*/
-  protected class MenuDragMouseHandler implements MenuDragMouseListener
+  private class MenuDragMouseHandler implements MenuDragMouseListener
   {
 /**
  * Tbis method is invoked when mouse is dragged over the menu item.
@@ -1010,7 +1021,7 @@
* This class handles key events occuring when menu item is visible on the
* screen.
*/
-  protected class MenuKeyHandler implements MenuKeyListener
+  private class MenuKeyHandler implements MenuKeyListener
   {
 /**
  * This method is invoked when key has been pressed
@@ -1051,7 +1062,7 @@
* Helper class that listens for changes to the properties of the [EMAIL PROTECTED]
* JMenuItem}.
*/
-  protected class PropertyChangeHandler implements PropertyChangeListener
+  private class PropertyChangeHandler implements PropertyChangeListener
   {
 /**
  * This method is called when one of the menu item's properties change.
@@ -1060,6 +1071,31 @@
  */
 public void propertyChange(PropertyChangeEvent evt)
 {
+  menuItem.revalidate();
+  menuItem.repaint();
+}
+  }
+  
+  /**
+   * Helper class that listens for item changes to the properties of the [EMAIL PROTECTED]
+   * JMenuItem}.
+   */
+  private class ItemHandler implements ItemListener
+  {
+/**
+ * This method is called when one of the menu item changes.
+ *
+ * @param evt A [EMAIL PROTECTED] ItemEvent}.
+ */
+public void itemStateChanged(ItemEvent evt)
+{
+  boolean state = false;
+  if (menuItem instanceof JCheckBoxMenuItem)
+{
+  if (evt.getStateChange() == ItemEvent.SELECTED)
+state = true;
+  ((JCheckBoxMenuItem) menuItem).setState(state);
+}
   menuItem.revalidate();
   menuItem.repaint();
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: LookAndFeel implementations, cleanup of BasicListUI and BasicTableUI

2005-10-20 Thread Anthony Balkissoon
This patch implements the stubbed methods loadKeyBindings, makeInputMap,
makeComponentInputMap, and makeKeyBindings in javax.swing.LookAndFeel.

I also noticed that a previous problem we had with improper modifiers
being sent with KeyEvents was fixed so I removed the private method
convertModifiers from BasicListUI and BasicTableUI and cleaned up the
code in installKeyBoardActions in both of those files.

2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]

* javax/swing/LookAndFeel.java:
(loadKeyBindings): Implemented and added docs.
(makeComponentInputMap): Likewise.
(makeInputMap): Likewise.
(makeKeyBindings): Likewise.
* javax/swing/plaf/basic/BasicListUI.java:
(convertModifiers): Removed this no longer needed private method.
(installKeyboardActions): Removed the code relating to modifier
conversion and made code more readable by using local variables.
* javax/swing/plaf/basic/BasicTableUI.java:
(convertModifiers): Removed this no longer needed private method.
(installKeyboardActions): Removed the code relating to modifier
conversion and made code more readbale by using local variables.

--Tony



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] Re: RFC: Don't call protected addURL() method from URLClassLoader constructors

2005-10-20 Thread Tom Tromey
 Mark == Mark Wielaard [EMAIL PROTECTED] writes:

Mark Yeah, yeah... :) I know that it doesn't beat having real comments for
Mark code. But I really do try running real known good applications before we
Mark make any release to check that nothing is broken.

In a case like this the issue is that someone modifying the code won't
know what application to test.  I sometimes add comments about
particular applications, e.g. see the note about Eclipse in
ResourceBundle.  I don't think there's much wrong with this practice.

In this particular case I'd like to see a comment mentioning jboss,
and perhaps an @specnote in the javadoc.

Tom



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: Added missing methods in org.ietf interface declarations.

2005-10-20 Thread Tom Tromey
 Audrius == Meskauskas Audrius [EMAIL PROTECTED] writes:

Audrius This patch adds the declaration of the hashCode method to these two 
Audrius interfaces. The method is inherited from Object, and explicit 
Audrius declaration just indicates that it must be overridden because the 
Audrius .equals must be overridden.

Audrius 2005-10-20  Audrius Meskauskas  [EMAIL PROTECTED]
Audrius * org/ietf/jgss/GSSCredential.java (hashCode),
Audrius org/ietf/jgss/GSSName.java (hashCode): New declarations.

There was already some discussion of this change on one of the
classpath lists.

Short form: this particular japi note is probably a japi bug.  And,
this patch doesn't actually change anything of note... interfaces
already implicitly inherit hashCode from Object (there is a special
case in the JLS for certain methods of Object).

I don't think that this patch hurts anything either.  Now that it is
in I'd prefer it remain, if for no other reason than to placate japi.
(FWIW I still want to see those RCSId patches go in as well...)

Tom



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] Exception message clarification

2005-10-20 Thread Guilhem Lavaux

Hi,

Here are some patches that were useful while debugging applications with 
kaffe (or debugging kaffe either). I think that we are never too verbose 
for some exceptions so this patch adds some verbosity to them.


ChangeLog entry:

2005-10-20  Guilhem Lavaux  [EMAIL PROTECTED]

* java/lang/Thread.java
(sleep): Better exception message.

* java/security/AccessControlContext.java
(checkPermission): Likewise.

* java/util/ResourceBundle.java
(getBundle): Likewise.

* java/util/SimpleTimeZone.java
(setStartRule): Added some documentation.

Index: java/lang/Thread.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/Thread.java,v
retrieving revision 1.15
diff -u -r1.15 Thread.java
--- java/lang/Thread.java   13 Sep 2005 22:19:15 -  1.15
+++ java/lang/Thread.java   20 Oct 2005 19:24:35 -
@@ -813,8 +813,11 @@
   {
 
 // Check parameters
-if (ms  0 || ns  0 || ns  99)
-  throw new IllegalArgumentException();
+if (ms  0 )
+  throw new IllegalArgumentException(Negative milliseconds:  + ms);
+
+if (ns  0 || ns  99)
+  throw new IllegalArgumentException(Nanoseconds ouf of range:  + ns);
 
 // Really sleep
 VMThread.sleep(ms, ns);
Index: java/security/AccessControlContext.java
===
RCS file: /cvsroot/classpath/classpath/java/security/AccessControlContext.java,v
retrieving revision 1.12
diff -u -r1.12 AccessControlContext.java
--- java/security/AccessControlContext.java 26 Sep 2005 01:06:46 -  
1.12
+++ java/security/AccessControlContext.java 20 Oct 2005 19:24:35 -
@@ -128,10 +128,20 @@
   public void checkPermission(Permission perm) throws AccessControlException
   {
 if (protectionDomains.length == 0)
-  throw new AccessControlException (permission not granted);
+  throw new AccessControlException (permission  
+   + perm 
+   +  not granted: no protection 
domains);
+
 for (int i = 0; i  protectionDomains.length; i++)
-  if (!protectionDomains[i].implies(perm))
-throw new AccessControlException (permission not granted);
+  {
+   final ProtectionDomain domain = protectionDomains[i];
+   if (!domain.implies(perm))
+ throw new AccessControlException (permission  
+   + perm 
+   +  not granted:  
+   + domain 
+   +  does not imply it.);
+  }
   }
 
   /**
Index: java/util/ResourceBundle.java
===
RCS file: /cvsroot/classpath/classpath/java/util/ResourceBundle.java,v
retrieving revision 1.35
diff -u -r1.35 ResourceBundle.java
--- java/util/ResourceBundle.java   13 Sep 2005 22:19:15 -  1.35
+++ java/util/ResourceBundle.java   20 Oct 2005 19:24:35 -
@@ -419,7 +419,11 @@
  }
   }
 
-throw new MissingResourceException(Bundle  + baseName +  not found,
+throw new MissingResourceException(Bundle  + baseName 
+  +  not found for locale 
+  + locale
+  +  by classloader 
+  + classLoader,
   baseName, );
   }
 
Index: java/util/SimpleTimeZone.java
===
RCS file: /cvsroot/classpath/classpath/java/util/SimpleTimeZone.java,v
retrieving revision 1.28
diff -u -r1.28 SimpleTimeZone.java
--- java/util/SimpleTimeZone.java   13 Sep 2005 22:19:15 -  1.28
+++ java/util/SimpleTimeZone.java   20 Oct 2005 19:24:35 -
@@ -468,6 +468,7 @@
* @param dayOfWeek The day of week where daylight savings start.
* @param time The time in milliseconds standard time where daylight
* savings start.
+   * @exception IllegalArgumentException if parameters are out of range.
* @see SimpleTimeZone
*/
   public void setStartRule(int month, int day, int dayOfWeek, int time)
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: ScrollPaneAdjustable patch fixes PR24235

2005-10-20 Thread Anthony Balkissoon
The patch suggested in the bug report
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24235) was essentially
correct, plus the specs require an explicit check for a null parameter.
This is committed.


2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]

* java/awt/ScrollPaneAdjustable.java:
(addAdjustmentListener): If parameter is null take no action and throw
no exception.  Store the resulting listener chain from call to 
AWTEventMulticaster.add.
(removeAdjustmentListener): If parameter is null take no action and
throw no exception.  Store the resulting listener chain from call to
AWTEventMulticaster.remove.

--Tony
Index: java/awt/ScrollPaneAdjustable.java
===
RCS file: /cvsroot/classpath/classpath/java/awt/ScrollPaneAdjustable.java,v
retrieving revision 1.9
diff -u -r1.9 ScrollPaneAdjustable.java
--- java/awt/ScrollPaneAdjustable.java	2 Jul 2005 20:32:25 -	1.9
+++ java/awt/ScrollPaneAdjustable.java	20 Oct 2005 19:31:20 -
@@ -87,12 +87,16 @@
   
   public void addAdjustmentListener (AdjustmentListener listener)
   {
-AWTEventMulticaster.add (adjustmentListener, listener);
+if (listener == null)
+  return;
+adjustmentListener = AWTEventMulticaster.add (adjustmentListener, listener);
   }
   
   public void removeAdjustmentListener (AdjustmentListener listener)
   {
-AWTEventMulticaster.remove (adjustmentListener, listener);
+if (listener == null)
+  return;
+adjustmentListener = AWTEventMulticaster.remove (adjustmentListener, listener);
   }
   
   public AdjustmentListener[] getAdjustmentListeners ()
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: LookAndFeel implementations, cleanup of BasicListUI and BasicTableUI

2005-10-20 Thread Anthony Balkissoon
Didn't send the patch, here it is.

On Thu, 2005-10-20 at 15:02 -0400, Anthony Balkissoon wrote:
 This patch implements the stubbed methods loadKeyBindings, makeInputMap,
 makeComponentInputMap, and makeKeyBindings in javax.swing.LookAndFeel.
 
 I also noticed that a previous problem we had with improper modifiers
 being sent with KeyEvents was fixed so I removed the private method
 convertModifiers from BasicListUI and BasicTableUI and cleaned up the
 code in installKeyBoardActions in both of those files.
 
 2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]
 
   * javax/swing/LookAndFeel.java:
   (loadKeyBindings): Implemented and added docs.
   (makeComponentInputMap): Likewise.
   (makeInputMap): Likewise.
   (makeKeyBindings): Likewise.
   * javax/swing/plaf/basic/BasicListUI.java:
   (convertModifiers): Removed this no longer needed private method.
   (installKeyboardActions): Removed the code relating to modifier
   conversion and made code more readable by using local variables.
   * javax/swing/plaf/basic/BasicTableUI.java:
   (convertModifiers): Removed this no longer needed private method.
   (installKeyboardActions): Removed the code relating to modifier
   conversion and made code more readbale by using local variables.
 
 --Tony
 
 
 
 ___
 Classpath-patches mailing list
 Classpath-patches@gnu.org
 http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/LookAndFeel.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/LookAndFeel.java,v
retrieving revision 1.14
diff -u -r1.14 LookAndFeel.java
--- javax/swing/LookAndFeel.java	19 Oct 2005 15:45:05 -	1.14
+++ javax/swing/LookAndFeel.java	20 Oct 2005 18:57:26 -
@@ -45,7 +45,9 @@
 import java.net.URL;
 
 import javax.swing.border.Border;
+import javax.swing.plaf.ComponentInputMapUIResource;
 import javax.swing.plaf.IconUIResource;
+import javax.swing.plaf.InputMapUIResource;
 import javax.swing.plaf.UIResource;
 import javax.swing.text.JTextComponent;
 
@@ -183,20 +185,47 @@
   public abstract boolean isSupportedLookAndFeel();
 
   /**
-   * Loads the bindings in keys into retMap. 
+   * Loads the bindings in keys into retMap. Does not remove existing entries
+   * from retMap.  codekeys/code describes the InputMap, every even indexed
+   * item is either a KeyStroke or a String representing a KeyStroke and every
+   * odd indexed item is the Object associated with that KeyStroke in an 
+   * ActionMap.
+   * 
+   * @param retMap the InputMap into which we load bindings
+   * @param keys the Object array describing the InputMap as above
*/
   public static void loadKeyBindings(InputMap retMap, Object[] keys)
   {
-// TODO: Implement this properly.
+if (keys == null)
+  return;
+for (int i = 0; i  keys.length - 1; i+= 2)
+  {
+Object key = keys[i];
+KeyStroke keyStroke;
+if (key instanceof KeyStroke)
+  keyStroke = (KeyStroke)key;
+else
+  keyStroke = KeyStroke.getKeyStroke((String)key);
+retMap.put(keyStroke, keys[i+1]);
+  }
   }
 
   /**
-   * Creates a ComponentInputMap from keys. 
+   * Creates a ComponentInputMap from keys.  
+   * codekeys/code describes the InputMap, every even indexed
+   * item is either a KeyStroke or a String representing a KeyStroke and every
+   * odd indexed item is the Object associated with that KeyStroke in an 
+   * ActionMap.
+   * 
+   * @param c the JComponent associated with the ComponentInputMap
+   * @param keys the Object array describing the InputMap as above
*/
   public static ComponentInputMap makeComponentInputMap(JComponent c,
 			Object[] keys)
   {
-return null;
+ComponentInputMap retMap = new ComponentInputMapUIResource(c);
+loadKeyBindings(retMap, keys);
+return retMap;
   }
 
   /**
@@ -217,18 +246,43 @@
 
   /**
* Creates a InputMap from keys. 
+   * codekeys/code describes the InputMap, every even indexed
+   * item is either a KeyStroke or a String representing a KeyStroke and every
+   * odd indexed item is the Object associated with that KeyStroke in an 
+   * ActionMap.
+   * 
+   * @param keys the Object array describing the InputMap as above
*/
   public static InputMap makeInputMap(Object[] keys)
   {
-return null;
+InputMap retMap = new InputMapUIResource();
+loadKeyBindings(retMap, keys);
+return retMap;
   }
 
   /**
-   * Convenience method for building lists of KeyBindings.  
+   * Convenience method for building lists of KeyBindings.
+   * codekeyBindingList/code is an array of KeyStroke-Action pairs where
+   * even indexed elements are KeyStrokes or Strings representing KeyStrokes
+   * and odd indexed elements are the associated Actions.
+   * 
+   * @param keyBindingList the array of KeyStroke-Action pairs
+   * @return a JTextComponent.KeyBinding array

[cp-patches] Re: FYI: Fixes for JLists

2005-10-20 Thread Anthony Balkissoon
Another note, earlier I checked in
gnu/testlet/javax/swing/DefaultListSelectionModel/leadSelectionIndex.java and 
we were failing it.  This patch makes us pass that test.

--Tony

On Thu, 2005-10-20 at 16:55 -0400, Anthony Balkissoon wrote:
 DefaultListSelectionModel.setLeadSelectionIndex wasn't respecting the
 list's selection mode, this is fixed.  I also fixed addSelectionInterval
 in the same file to handle SINGLE_SELECTION mode better.
 
 Finally, there was an off-by-one problem in JList.getSelectedIndices
 that I fixed.
 
 2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]
 
   * javax/swing/DefaultListSelectionModel.java:
   (setLeadSelectionIndex): If the selection mode is SINGLE_SELECTION then
   pass this call to setSelectionInterval.
   (addSelectionInterval): If the selection mode is SINGLE_SELECTION then 
   pass the call to setSelectionInterval and avoid the lengthy checks
   that don't apply to this mode.
   * javax/swing/JList.java:
   (getSelectedIndices): Changed bounds of for loop to include the 
   maxSelectionIndex.
 
 --Tony



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: java/lang/reflect/Proxy.java fix

2005-10-20 Thread Jeroen Frijters
Hi,

There was a bootstrap / system class loader confusion bug in Proxy. I
committed the attached patch to fix it.

Regards,
Jeroen

2005-10-21  Jeroen Frijters  [EMAIL PROTECTED]

* java/lang/reflect/Proxy.java
(ProxyType.ProxyType): Don't replace null with system class
loader.
(ProxyType.hashCode): Handle null loader.
Index: java/lang/reflect/Proxy.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/reflect/Proxy.java,v
retrieving revision 1.24
diff -u -r1.24 Proxy.java
--- java/lang/reflect/Proxy.java26 Sep 2005 18:44:38 -  1.24
+++ java/lang/reflect/Proxy.java21 Oct 2005 00:03:52 -
@@ -413,8 +413,6 @@
  */
 ProxyType(ClassLoader loader, Class[] interfaces)
 {
-  if (loader == null)
- loader = ClassLoader.getSystemClassLoader();
   this.loader = loader;
   this.interfaces = interfaces;
 }
@@ -426,8 +424,7 @@
  */
 public int hashCode()
 {
-  //loader is always not null
-  int hash = loader.hashCode();
+  int hash = loader == null ? 0 : loader.hashCode();
   for (int i = 0; i  interfaces.length; i++)
 hash = hash * 31 + interfaces[i].hashCode();
   return hash;
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[commit-cp] classpath ./ChangeLog org/ietf/jgss/GSSCredenti...

2005-10-20 Thread Audrius Meškauskas
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Audrius Meškauskas [EMAIL PROTECTED] 05/10/20 08:42:37

Modified files:
.  : ChangeLog 
org/ietf/jgss  : GSSCredential.java GSSName.java 

Log message:
2005-10-20  Audrius Meskauskas  [EMAIL PROTECTED]

* org/ietf/jgss/GSSCredential.java (hashCode),
org/ietf/jgss/GSSName.java (hashCode): New declarations.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5300tr2=1.5301r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/org/ietf/jgss/GSSCredential.java.diff?tr1=1.3tr2=1.4r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/org/ietf/jgss/GSSName.java.diff?tr1=1.3tr2=1.4r1=textr2=text





[commit-cp] classpath ./ChangeLog javax/swing/plaf/basic/Ba...

2005-10-20 Thread David Gilbert
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: David Gilbert [EMAIL PROTECTED]   05/10/20 14:55:02

Modified files:
.  : ChangeLog 
javax/swing/plaf/basic: BasicArrowButton.java 

Log message:
2005-10-20  David Gilbert  [EMAIL PROTECTED]

* javax/swing/plaf/basic/BasicArrowButton.java: Updated API docs all
over, plus:
(defaultSize): removed field,
(upIcon): removed field,
(downIcon): removed field,
(leftIcon): removed field,
(rightIcon): removed field,
(darkShadow): changed color value,
(paint): ignore insets for triangle positioning, but check 'armed'
state,
(paintTriangle): delegate to new private methods depending on
direction,
(paintTriangleNorth): new private method,
(paintTriangleSouth): new private method,
(paintTriangleEast): new private method,
(paintTriangleWest): new private method.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5301tr2=1.5302r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/plaf/basic/BasicArrowButton.java.diff?tr1=1.15tr2=1.16r1=textr2=text





[commit-cp] classpath javax/swing/text/BoxView.java ./Chang...

2005-10-20 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Roman Kennke [EMAIL PROTECTED]05/10/20 18:34:45

Modified files:
javax/swing/text: BoxView.java 
.  : ChangeLog 

Log message:
2005-10-20  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/text/BoxView.java
(layoutMinorAxis): Calculate total requirements before calling
the SizeRequirements utility method. Avoids an NPE.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/text/BoxView.java.diff?tr1=1.8tr2=1.9r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5302tr2=1.5303r1=textr2=text





[commit-cp] classpath ./ChangeLog javax/swing/plaf/basic/Ba...

2005-10-20 Thread Lillian Angel
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Lillian Angel [EMAIL PROTECTED]   05/10/20 18:43:11

Modified files:
.  : ChangeLog 
javax/swing/plaf/basic: BasicMenuItemUI.java 

Log message:
2005-10-20  Lillian Angel  [EMAIL PROTECTED]

* javax/swing/plaf/basic/BasicMenuItemUI.java:
Added new ItemListener field.
(BasicMenuItemUI): Initialized new field.
(installListeners): Installed new listener.
(removeListeners): Removed new listener.
(MenuDragMouseHandler): Class should be private, not
in API.
(MenuKeyHandler): Likewise.
(PropertyChangeHandler): Likewise.
(ItemHandler): New class implemented to change the
state of the menu item if it is a checkbox menu item.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5303tr2=1.5304r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java.diff?tr1=1.30tr2=1.31r1=textr2=text





[commit-cp] classpath ./ChangeLog javax/swing/LookAndFeel.j...

2005-10-20 Thread Anthony Balkissoon
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Anthony Balkissoon [EMAIL PROTECTED]  05/10/20 18:58:47

Modified files:
.  : ChangeLog 
javax/swing: LookAndFeel.java 
javax/swing/plaf/basic: BasicTableUI.java BasicListUI.java 

Log message:
2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]

* javax/swing/LookAndFeel.java:
(loadKeyBindings): Implemented and added docs.
(makeComponentInputMap): Likewise.
(makeInputMap): Likewise.
(makeKeyBindings): Likewise.
* javax/swing/plaf/basic/BasicListUI.java:
(convertModifiers): Removed this no longer needed private method.
(installKeyboardActions): Removed the code relating to modifier
conversion and made code more readable by using local variables.
* javax/swing/plaf/basic/BasicTableUI.java:
(convertModifiers): Removed this no longer needed private method.
(installKeyboardActions): Removed the code relating to modifier
conversion and made code more readbale by using local variables.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5304tr2=1.5305r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/LookAndFeel.java.diff?tr1=1.14tr2=1.15r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/plaf/basic/BasicTableUI.java.diff?tr1=1.33tr2=1.34r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/plaf/basic/BasicListUI.java.diff?tr1=1.35tr2=1.36r1=textr2=text





[commit-cp] classpath ./ChangeLog java/awt/ScrollPaneAdjust...

2005-10-20 Thread Anthony Balkissoon
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Anthony Balkissoon [EMAIL PROTECTED]  05/10/20 19:35:07

Modified files:
.  : ChangeLog 
java/awt   : ScrollPaneAdjustable.java 

Log message:
2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]

* java/awt/ScrollPaneAdjustable.java:
(addAdjustmentListener): If parameter is null take no action and throw
no exception.  Store the resulting listener chain from call to
AWTEventMulticaster.add.
(removeAdjustmentListener): If parameter is null take no action and
throw no exception.  Store the resulting listener chain from call to
AWTEventMulticaster.remove.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5305tr2=1.5306r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/java/awt/ScrollPaneAdjustable.java.diff?tr1=1.9tr2=1.10r1=textr2=text





[commit-cp] classpath ./ChangeLog examples/gnu/classpath/ex...

2005-10-20 Thread Lillian Angel
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Lillian Angel [EMAIL PROTECTED]   05/10/20 20:21:29

Modified files:
.  : ChangeLog 
examples/gnu/classpath/examples/swing: Demo.java 
javax/swing: ButtonGroup.java JToggleButton.java 
javax/swing/plaf/metal: MetalRadioButtonUI.java 

Log message:
2005-10-20  Lillian Angel  [EMAIL PROTECTED]

* examples/gnu/classpath/examples/swing/Demo.java
(mkRadio): Changed to create a panel that contains
2 buttons in a ButtonGroup.
* javax/swing/ButtonGroup.java
(add): Fixed to initialize sel if the newly added
button is already selected.
* javax/swing/JToggleButton.java
(isSelected): Implemented.
(setSelected): Implemented.
* javax/swing/plaf/metal/MetalRadioButtonUI.java
(paintFocus): Fixed size of border drawn around the
radio button.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5306tr2=1.5307r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/examples/gnu/classpath/examples/swing/Demo.java.diff?tr1=1.22tr2=1.23r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/ButtonGroup.java.diff?tr1=1.11tr2=1.12r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/JToggleButton.java.diff?tr1=1.26tr2=1.27r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/plaf/metal/MetalRadioButtonUI.java.diff?tr1=1.4tr2=1.5r1=textr2=text





[commit-cp] classpath ./ChangeLog javax/swing/DefaultListSe...

2005-10-20 Thread Anthony Balkissoon
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Anthony Balkissoon [EMAIL PROTECTED]  05/10/20 20:53:14

Modified files:
.  : ChangeLog 
javax/swing: DefaultListSelectionModel.java JList.java 

Log message:
2005-10-20  Anthony Balkissoon  [EMAIL PROTECTED]

* javax/swing/DefaultListSelectionModel.java:
(setLeadSelectionIndex): If the selection mode is SINGLE_SELECTION then
pass this call to setSelectionInterval.
(addSelectionInterval): If the selection mode is SINGLE_SELECTION then
pass the call to setSelectionInterval and avoid the lengthy checks
that don't apply to this mode.
* javax/swing/JList.java:
(getSelectedIndices): Changed bounds of for loop to include the
maxSelectionIndex.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5307tr2=1.5308r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/DefaultListSelectionModel.java.diff?tr1=1.23tr2=1.24r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/javax/swing/JList.java.diff?tr1=1.36tr2=1.37r1=textr2=text





[commit-cp] classpath ./ChangeLog java/lang/reflect/Proxy.java

2005-10-20 Thread Jeroen Frijters
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Jeroen Frijters [EMAIL PROTECTED] 05/10/21 00:30:28

Modified files:
.  : ChangeLog 
java/lang/reflect: Proxy.java 

Log message:
2005-10-21  Jeroen Frijters  [EMAIL PROTECTED]

* java/lang/reflect/Proxy.java
(ProxyType.ProxyType): Don't replace null with system class loader.
(ProxyType.hashCode): Handle null loader.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.5308tr2=1.5309r1=textr2=text
http://savannah.gnu.org/cgi-bin/viewcvs/classpath/classpath/java/lang/reflect/Proxy.java.diff?tr1=1.24tr2=1.25r1=textr2=text