[cp-patches] FYI: L&F window decorations fixes

2006-04-08 Thread Roman Kennke
The attached patch improves the Look and Feel window decorations for
Metal in the following ways:
- When the theme changes, the window decorations no longer disappear.
This has been the case, because the decorations weren't correctly (un-)
installed before.
- Dragging the window is now possible when in L&F window decoration
mode. I had to add a mouse handler to the title pane which checks drag
events and move the window ancestor appropriately. My previous patch to
GtkWindowPeer makes this not flicker like mad.

2006-04-08  Roman Kennke  <[EMAIL PROTECTED]>

* javax/swing/plaf/metal/MetalRootPaneUI.java
(MetalTitlePane.MouseHandler): New inner class to handle
dragging
of frames.
(MetalTitlePane.installListeners): Don't register a focus
listener
on the window. This is a potential memory leak and must be
implemented on a different way. Install mouse listener here.
(installWindowDecorations): Fixed assertion condition. Always
insert the window decoration at index#1 in the layered
pane.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/plaf/metal/MetalRootPaneUI.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalRootPaneUI.java,v
retrieving revision 1.5
diff -u -1 -0 -r1.5 MetalRootPaneUI.java
--- javax/swing/plaf/metal/MetalRootPaneUI.java	25 Mar 2006 18:23:20 -	1.5
+++ javax/swing/plaf/metal/MetalRootPaneUI.java	8 Apr 2006 23:09:37 -
@@ -40,43 +40,44 @@
 
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.Frame;
 import java.awt.Graphics;
 import java.awt.Insets;
 import java.awt.LayoutManager;
 import java.awt.LayoutManager2;
+import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.Window;
 import java.awt.event.ActionEvent;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowFocusListener;
+import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 
 import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JLayeredPane;
 import javax.swing.JMenu;
 import javax.swing.JMenuBar;
 import javax.swing.JRootPane;
 import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import javax.swing.border.AbstractBorder;
+import javax.swing.event.MouseInputAdapter;
 import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.basic.BasicRootPaneUI;
 
 /**
  * A UI delegate for the [EMAIL PROTECTED] JRootPane} component. This implementation
  * supports the JRootPane windowDecorationStyle property.  
  * 
  * @author Roman Kennke ([EMAIL PROTECTED])
  *
  * @since 1.4
@@ -184,20 +185,64 @@
   /**
* The component that renders the title bar for frames. This duplicates
* most of [EMAIL PROTECTED] MetalInternalFrameTitlePane}. It is not reasonably possible
* to reuse that class because that is bound to the JInternalFrame and we
* need to handle JFrames/JRootPanes here.
*
* @author Roman Kennke ([EMAIL PROTECTED])
*/
   private static class MetalTitlePane extends JComponent
   {
+
+/**
+ * Handles dragging of the title pane and moves the window accordingly.
+ */
+private class MouseHandler
+  extends MouseInputAdapter
+{
+  /**
+   * The point where the dragging started.
+   */
+  Point lastDragLocation;
+
+  /**
+   * Receives notification when the mouse gets pressed on the title pane.
+   * This updates the lastDragLocation.
+   *
+   * @param ev the mouse event
+   */
+  public void mousePressed(MouseEvent ev)
+  {
+lastDragLocation = ev.getPoint();
+  }
+
+  /**
+   * Receives notification when the mouse is dragged on the title pane.
+   * This will move the nearest window accordingly.
+   *
+   * @param ev the mouse event
+   */
+  public void mouseDragged(MouseEvent ev)
+  {
+Point dragLocation = ev.getPoint();
+int deltaX = dragLocation.x - lastDragLocation.x;
+int deltaY = dragLocation.y - lastDragLocation.y;
+Window window = SwingUtilities.getWindowAncestor(rootPane);
+Point loc = window.getLocation();
+window.setLocation(loc.x + deltaX, loc.y + deltaY);
+// Note that we do not update the lastDragLocation. This is because
+// we move the underlying window while dragging the component, which
+// results in having the same lastDragLocation under the mouse while
+// dragging.
+  }
+}
+
 /**
  * The Action responsible for closing the JInternalFrame.
  */
 private cl

[cp-patches] FYI: GtkWindowPeer fix

2006-04-08 Thread Roman Kennke
I changed the nativeSetBoundsUnlocked() method in GtkWindowPeer, so that
it only requests GTK to resize the window, when the actual values for
height or width change. This avoids nasty flicker when only
setLocation() is beeing called, because GTK seems to clear the
background even when the values don't change.

2006-04-08  Roman Kennke  <[EMAIL PROTECTED]>

* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c

(Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetBoundsUnlocked):
Only resize window if actual width or height value changes.
Avoids nasty flicker when only setLocation() is beeing called
on a window.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
===
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,v
retrieving revision 1.65
diff -u -1 -0 -r1.65 gnu_java_awt_peer_gtk_GtkWindowPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	15 Feb 2006 20:55:07 -	1.65
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	8 Apr 2006 22:56:08 -
@@ -1417,20 +1417,22 @@
 (env, obj, x, y);
 
   gdk_threads_leave ();
 }
 
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetBoundsUnlocked
   (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
 {
   void *ptr;
+  gint current_width;
+  gint current_height;
 
   ptr = NSA_GET_PTR (env, obj);
 
   /* Avoid GTK runtime assertion failures. */
   width = (width < 1) ? 1 : width;
   height = (height < 1) ? 1 : height;
 
   gtk_window_move (GTK_WINDOW(ptr), x, y);
   /* The call to gdk_window_move is needed in addition to the call to
  gtk_window_move.  If gdk_window_move isn't called, then the
@@ -1440,26 +1442,33 @@
  2. manually move it to another position on the screen
  3. hide the window
  4. reposition the window with Component.setLocation
  5. show the window
 
  Instead of being at the position set by setLocation, the window
  is reshown at the position to which it was moved manually. */
   if (GTK_WIDGET (ptr)->window != NULL)
 gdk_window_move (GTK_WIDGET (ptr)->window, x, y);
 
-  /* Need to change the widget's request size. */
-  gtk_widget_set_size_request (GTK_WIDGET(ptr), width, height);
-  /* Also need to call gtk_window_resize.  If the resize is requested
- by the program and the window's "resizable" property is true then
- the size request will not be honoured. */
-  gtk_window_resize (GTK_WINDOW (ptr), width, height);
+  /* Only request resizing if the actual width or height change, otherwise
+   * we get unnecessary flickers because resizing causes GTK to clear the
+   * window content, even if the actual size doesn't change. */
+  gtk_window_get_size(GTK_WINDOW(ptr), ¤t_width, ¤t_height);
+  if (current_width != width || current_height != height)
+{
+  /* Need to change the widget's request size. */
+  gtk_widget_set_size_request (GTK_WIDGET(ptr), width, height);
+  /* Also need to call gtk_window_resize.  If the resize is requested
+	 by the program and the window's "resizable" property is true then
+	 the size request will not be honoured. */
+  gtk_window_resize (GTK_WINDOW (ptr), width, height);
+}
 }
 
 static void
 window_get_frame_extents (GtkWidget *window,
   int *top, int *left, int *bottom, int *right)
 {
   unsigned long *extents = NULL;
   union extents_union gu_ex;
 
   /* Guess frame extents in case _NET_FRAME_EXTENTS is not


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[cp-patches] FYI: More informative exception for solving CORBA interoperability problems.

2006-04-08 Thread Audrius Meskauskas

2006-04-08  Audrius Meskauskas  <[EMAIL PROTECTED]>

   * gnu/CORBA/GIOP/MessageHeader.java (read): Throw more informative
   exception if the magic sequence does not match.
Index: MessageHeader.java
===
RCS file: /sources/classpath/classpath/gnu/CORBA/GIOP/MessageHeader.java,v
retrieving revision 1.9
diff -u -r1.9 MessageHeader.java
--- MessageHeader.java	8 Apr 2006 19:43:55 -	1.9
+++ MessageHeader.java	8 Apr 2006 20:14:22 -
@@ -273,29 +273,19 @@
* Read the header from the stream.
* 
* @param istream a stream to read from.
+   * 
* @throws MARSHAL if this is not a GIOP 1.0 header.
*/
-  public void read(java.io.InputStream istream) throws MARSHAL
+  public void read(java.io.InputStream istream)
+throws MARSHAL
   {
 try
   {
 byte[] xMagic = new byte[MAGIC.length];
-int r = istream.read(xMagic);
-if (! Arrays.equals(xMagic, MAGIC))
+istream.read(xMagic);
+if (!Arrays.equals(xMagic, MAGIC))
   {
-StringBuffer b = new StringBuffer();
-if (r == - 1)
-  b.append("Immediate EOF");
-else
-  {
-b.append(r + " bytes: ");
-for (int i = 0; i < xMagic.length; i++)
-  {
-b.append(Integer.toHexString(xMagic[i] & 0xFF));
-b.append(' ');
-  }
-  }
-MARSHAL m = new MARSHAL("Not a GIOP message: " + b);
+MARSHAL m = new MARSHAL("Not a GIOP message");
 m.minor = Minor.Giop;
 throw m;
   }


[cp-patches] Re:Re: ORBit with Classpath CORBA:Java Accessibility Bridge for GNOME loaded.

2006-04-08 Thread Audrius Meskauskas
Yes, the implementation expects the message header, but receives the end 
of stream because it has sent a one way message. Try after this patch, 
seems registering something now.


2006-04-08  Audrius Meskauskas  <[EMAIL PROTECTED]>

   * gnu/CORBA/gnuRequest.java (p_invoke, submit): Do not try to read
   response for the one way messages.
Index: gnuRequest.java
===
RCS file: /sources/classpath/classpath/gnu/CORBA/gnuRequest.java,v
retrieving revision 1.18
diff -u -r1.18 gnuRequest.java
--- gnuRequest.java	28 Oct 2005 14:05:21 -	1.18
+++ gnuRequest.java	8 Apr 2006 19:26:36 -
@@ -833,7 +833,9 @@
 request_part.buffer.writeTo(socketOutput);
 
 socketOutput.flush();
-if (!socket.isClosed())
+// If the message is sent one way, we do not care about the response
+// that may never come.
+if (!socket.isClosed() && !oneWay)
   {
 MessageHeader response_header = new MessageHeader();
 InputStream socketInput = socket.getInputStream();
@@ -937,6 +939,10 @@
 throws SystemException, ForwardRequest
   {
 RawReply response = submit();
+
+// If this is a one way message, do not care about the response.
+if (oneWay && response == EMPTY)
+  return;
 
 if (m_rph == null)
   m_rph = response.header.create_reply_header();


[cp-patches] RFC: Most reverse japi fixes in org.omg

2006-04-08 Thread Wolfgang Baer
Hi,

this patch fixes most of the reverse japi issues. Things that
remain (will be seen if the patch is applied after a japi run)
will require deep knowledge of the Corba stuff. So I will leave
that to Audrius :-)

Most stuff in the patch is that some classes does not extend
from _DynAnyStub and therefore the methods are copied into this
classes from there. There are also some methods which must be
abstract and therefore the default implementation to be removed or
moved into the implementation classes.

Posted as RFC to give Audrius a change to look at it. Everything
compiles and the Corba example still works.

2006-04-08  Wolfgang Baer  <[EMAIL PROTECTED]>

* org/omg/PortableServer/ServantLocatorPOA.java:
(preinvoke, postinvoke): Remove default implementation.
* org/omg/PortableServer/ServantActivatorPOA.java:
(incarnate, etherealize): Remove default implementation.
* org/omg/PortableInterceptor/ObjectReferenceFactory.java:
Extends from ValueBase and not from ObjectReferenceFactoryOperations.
(make_object): Moved method from ObjectReferenceFactoryOperations.
* org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java:
Removed unspecified interface.  
* org/omg/DynamicAny/_DynAnyStub.java:
(_DynAnyStub(Delegate)): Removed constructor.
* org/omg/DynamicAny/_DynArrayStub.java,
* org/omg/DynamicAny/_DynAnyFactoryStub.java,
* org/omg/DynamicAny/_DynEnumStub.java,
* org/omg/DynamicAny/_DynFixedStub.java,
* org/omg/DynamicAny/_DynSequenceStub.java,
* org/omg/DynamicAny/_DynStructStub.java,
* org/omg/DynamicAny/_DynUnionStub.java,
* org/omg/DynamicAny/_DynValueStub.java:
Extend from ObjectImpl and not from _DynAnyStub.
(type, next, destroy, copy, rewind, assign, component_count,
current_component, equal, from_any, get_any, get_boolean, get_char,
get_double, get_dyn_any, get_float, get_long, get_longlong, get_octet,
get_reference, get_short, get_string, get_typecode, get_ulong,
get_ulonglong, get_ushort, get_val, get_wchar, get_wstring, insert_any,
insert_boolean, insert_char, insert_double, insert_dyn_any, 
insert_float,
insert_long, insert_longlong, insert_octet, insert_reference,
insert_short, insert_string, insert_typecode, insert_ulong,
insert_ulonglong, insert_ushort, insert_val, insert_wchar,
insert_wstring, seek, to_any): New methods copied from _DynAnyStub. 

* org/omg/CosNaming/_BindingIteratorStub.java:
(_BindingIteratorStub(Delegate)): Made package private.
* org/omg/CosNaming/_NamingContextExtStub.java:
(_NamingContextExtStub(Delegate)): Made package private.
* org/omg/CosNaming/_NamingContextStub.java:
(_NamingContextStub(Delegate)): Made package private.
(throw4, throw5): Likewise.
* gnu/CORBA/NamingService/NameParser.java (resolve):
Adapt to package private constructor. Use _set_delegate instead.
* org/omg/CosNaming/NamingContextOperations.java: Do not extend 
IDLEntity.
* org/omg/CORBA/ORB.java:
(create_recursive_sequence_tc): Made abstract.
(get_default_context): Likewise.
* gnu/CORBA/OrbRestricted.java:
(create_recursive_sequence_tc): New moved method.
(get_default_context): Likewise.
* org/omg/CORBA/ParameterMode.java:
(PARAM_IN, PARAM_OUT, PARAM_INOUT): Made final. 

The patch does not include the removal of
org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java

Wolfgang



OMG_ReverseJapiFixes.patch.gz
Description: GNU Zip compressed data


[cp-patches] FYI: Implemented menu key handling stubs

2006-04-08 Thread Roman Kennke
I implemented a couple of stubs in Swing related to menu key handling.
This does not yet enable key navigation in menus though.

2006-04-08  Roman Kennke  <[EMAIL PROTECTED]>

* javax/swing/MenuSelectionManager.java
(processKeyEvent): Implemented stub method.
* javax/swing/JMenu.java
(processKeyEvent): Implemented stub method.
* javax/swing/JMenu.java
(processKeyEvent): Implemented stub method.
(processMenuKeyEvent): Implemented stub method.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/JMenu.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JMenu.java,v
retrieving revision 1.24
diff -u -1 -0 -r1.24 JMenu.java
--- javax/swing/JMenu.java	13 Mar 2006 21:33:37 -	1.24
+++ javax/swing/JMenu.java	8 Apr 2006 16:50:15 -
@@ -48,21 +48,20 @@
 import java.io.Serializable;
 import java.util.EventListener;
 
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 import javax.accessibility.AccessibleSelection;
 import javax.swing.event.MenuEvent;
 import javax.swing.event.MenuListener;
 import javax.swing.plaf.MenuItemUI;
-import javax.swing.plaf.PanelUI;
 
 /**
  * This class represents a menu that can be added to a menu bar or
  * can be a submenu in some other menu. When JMenu is selected it
  * displays JPopupMenu containing its menu items.
  *
  * 
  * JMenu's fires MenuEvents when this menu's selection changes. If this menu
  * is selected, then fireMenuSelectedEvent() is invoked. In case when menu is
  * deselected or cancelled, then fireMenuDeselectedEvent() or 
@@ -758,21 +757,21 @@
 throw new Error("setAccelerator() is not defined for JMenu.  Use setMnemonic() instead.");
   }
 
   /**
* This method process KeyEvent occuring when the menu is visible
*
* @param event The KeyEvent
*/
   protected void processKeyEvent(KeyEvent event)
   {
-// TODO: Implement this properly.
+MenuSelectionManager.defaultManager().processKeyEvent(event);
   }
 
   /**
* Programatically performs click
*
* @param time Number of milliseconds for which this menu stays pressed
*/
   public void doClick(int time)
   {
 getModel().setArmed(true);
Index: javax/swing/JMenuItem.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JMenuItem.java,v
retrieving revision 1.27
diff -u -1 -0 -r1.27 JMenuItem.java
--- javax/swing/JMenuItem.java	13 Mar 2006 21:33:37 -	1.27
+++ javax/swing/JMenuItem.java	8 Apr 2006 16:50:15 -
@@ -49,21 +49,20 @@
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.event.MenuDragMouseEvent;
 import javax.swing.event.MenuDragMouseListener;
 import javax.swing.event.MenuKeyEvent;
 import javax.swing.event.MenuKeyListener;
 import javax.swing.plaf.MenuItemUI;
-import javax.swing.plaf.PanelUI;
 
 /**
  * JMenuItem represents element in the menu. It inherits most of
  * its functionality from AbstractButton, however its behavior somewhat
  * varies from it. JMenuItem fire different kinds of events.
  * PropertyChangeEvents are fired when menuItems properties are modified;
  * ChangeEvents are fired when menuItem's state changes and actionEvents are
  * fired when menu item is selected. In addition to this events menuItem also
  * fire MenuDragMouseEvent and MenuKeyEvents when mouse is dragged over
  * the menu item or associated key with menu item is invoked respectively.
@@ -390,21 +389,29 @@
   /**
* Process key events forwarded from MenuSelectionManager.
*
* @param event event forwarded from MenuSelectionManager
* @param path path to the menu element from which event was generated
* @param manager MenuSelectionManager for the current menu hierarchy
*/
   public void processKeyEvent(KeyEvent event, MenuElement[] path,
   MenuSelectionManager manager)
   {
-// Need to implement.
+MenuKeyEvent e = new MenuKeyEvent(event.getComponent(), event.getID(),
+  event.getWhen(), event.getModifiers(),
+  event.getKeyCode(), event.getKeyChar(),
+  path, manager);
+processMenuKeyEvent(e);
+
+// Consume original key event, if the menu key event has been consumed.
+if (e.isConsumed())
+  event.consume();
   }
 
   /**
* This method fires MenuDragMouseEvents to registered listeners.
* Different types of MenuDragMouseEvents are fired depending
* on the observed mouse event.
*
* @param event Mouse
*/
   public void processMen

[cp-patches] FYI: AbstractAction cleanup

2006-04-08 Thread Roman Kennke
While going over some Swing code I noticed that the AbstractAction has
unimplemented readObject and writeObject methods. Since serialization is
not supported for Swing anyway, I removed both methods.

2006-04-08  Roman Kennke  <[EMAIL PROTECTED]>

* javax/swing/AbstractAction.java
(readObject): Removed unneeded method.
(writeObject): Removed unneeded method.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/AbstractAction.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractAction.java,v
retrieving revision 1.20
diff -u -1 -0 -r1.20 AbstractAction.java
--- javax/swing/AbstractAction.java	3 Mar 2006 11:15:02 -	1.20
+++ javax/swing/AbstractAction.java	8 Apr 2006 15:31:38 -
@@ -33,23 +33,20 @@
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
 
 package javax.swing;
 
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.util.HashMap;
 
 import javax.swing.event.SwingPropertyChangeSupport;
 
 /**
  * A base class for implementing the [EMAIL PROTECTED] Action} interface.
  * 
  * @author Andrew Selkirk
  */
@@ -103,46 +100,20 @@
* @param name  the name (null permitted).
* @param icon  the icon (null permitted).
*/
   public AbstractAction(String name, Icon icon)
   {
 putValue(NAME, name);
 putValue(SMALL_ICON, icon);
   }
 
   /**
-   * readObject
-   *
-   * @param stream the stream to read from
-   *
-   * @exception ClassNotFoundException TODO
-   * @exception IOException if an error occurs
-   */
-  private void readObject(ObjectInputStream stream)
-throws ClassNotFoundException, IOException
-  {
-// TODO
-  }
-
-  /**
-   * writeObject
-   *
-   * @param stream the stream to write to
-   *
-   * @exception IOException if an error occurs
-   */
-  private void writeObject(ObjectOutputStream stream) throws IOException
-  {
-// TODO
-  }
-
-  /**
* Returns a clone of the action.
*
* @return A clone of the action.
*
* @exception CloneNotSupportedException if there is a problem cloning the
*action.
*/
   protected Object clone() throws CloneNotSupportedException
   {
 AbstractAction copy = (AbstractAction) super.clone();


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[cp-patches] RFC: gnu.regexp: Unicode-aware case folding

2006-04-08 Thread Ito Kazumitsu
Hi,

gnu.regexp, by default, is Unocode-aware when it performs a
case-insensitive matching, i.e. it uses Character.toLowerCase or
Character.toUpperCase.

On the other hand, java.util.regex, by default, should be aware
only of US-ASCII alphabet when it performs a case-insensitive
matching.

This patch fills the gap.

ChangeLog:
2006-04-08  Ito Kazumitsu  <[EMAIL PROTECTED]>

* gnu/regexp/REToken.java(unicodeAware): New field,
(toLowerCase, toUpperCase): New methods.
* gnu/regexp/RETokenBackRef.java, gnu/regexp/RETokenChar.java,
gnu/regexp/RETokenNamedProperty.java, gnu/regexp/RETokenRange.java:
Use toLowerCase and toUpperCase defined in REToken instead of
those defined in java.lang.Character.
* gnu/regexp/gnu/regexp/RE.java(REG_ICASE_USASCII): New flag.
(initialize): Sets unicodeAware of the generated REToken to false if
REG_ICASE_USASCII is set.
* java/util/regex/Pattern.java: Sets the flag REG_ICASE_USASCII to true.

Index: classpath/gnu/regexp/RE.java
===
RCS file: /cvsroot/classpath/classpath/gnu/regexp/RE.java,v
retrieving revision 1.22
diff -u -r1.22 RE.java
--- classpath/gnu/regexp/RE.java4 Apr 2006 16:20:50 -   1.22
+++ classpath/gnu/regexp/RE.java8 Apr 2006 16:03:47 -
@@ -245,9 +245,13 @@
* Compilation flag. Allow whitespace and comments in pattern.
* This is equivalent to the "/x" operator in Perl.
*/
-
   public static final int REG_X_COMMENTS = 0x0400;
 
+  /**
+   * Compilation flag. If set, REG_ICASE is effective only for US-ASCII.
+   */
+  public static final int REG_ICASE_USASCII = 0x0800;
+
   /** Returns a string representing the version of the gnu.regexp package. */
   public static final String version() {
 return VERSION;
@@ -347,6 +351,7 @@
 // Precalculate these so we don't pay for the math every time we
 // need to access them.
 boolean insens = ((cflags & REG_ICASE) > 0);
+boolean insensUSASCII = ((cflags & REG_ICASE_USASCII) > 0);
 
 // Parse pattern into tokens.  Does anyone know if it's more efficient
 // to use char[] than a String.charAt()?  I'm assuming so.
@@ -458,6 +463,7 @@
 else {
   addToken(currentToken);
   currentToken = new RETokenChar(subIndex,unit.ch,insens);
+ if (insensUSASCII) currentToken.unicodeAware = false;
 } 
   }
   
@@ -533,7 +539,7 @@
  case 'd':
  case 'm':
  case 's':
- // case 'u':  not supported
+ case 'u':
  case 'x':
  case '-':
 if (!syntax.get(RESyntax.RE_EMBEDDED_FLAGS)) break;
@@ -573,7 +579,13 @@
newCflags |= REG_DOT_NEWLINE;
  flagIndex++;
  break;
-   // case 'u': not supported
+   case 'u':
+ if (negate)
+   newCflags |= REG_ICASE_USASCII;
+ else
+   newCflags &= ~REG_ICASE_USASCII;
+ flagIndex++;
+ break;
case 'x':
  if (negate)
newCflags &= ~REG_X_COMMENTS;
@@ -597,6 +609,7 @@
syntax = newSyntax;
cflags = newCflags;
insens = ((cflags & REG_ICASE) > 0);
+   insensUSASCII = ((cflags & REG_ICASE_USASCII) > 0);
// This can be treated as though it were a comment.
comment = true;
index = flagIndex - 1;
@@ -609,6 +622,7 @@
syntax = newSyntax;
cflags = newCflags;
insens = ((cflags & REG_ICASE) > 0);
+   insensUSASCII = ((cflags & REG_ICASE_USASCII) > 0);
index = flagIndex -1;
// Fall through to the next case.
}
@@ -717,6 +731,7 @@
  syntax = savedSyntax;
  cflags = savedCflags;
  insens = ((cflags & REG_ICASE) > 0);
+ insensUSASCII = ((cflags & REG_ICASE_USASCII) > 0);
  flagsSaved = false;
  }
} // not a comment
@@ -829,6 +844,7 @@
index = index - 2 + ce.len;
addToken(currentToken);
currentToken = new RETokenChar(subIndex,ce.ch,insens);
+   if (insensUSASCII) currentToken.unicodeAware = false;
   }
 
   // BACKREFERENCE OPERATOR
@@ -856,6 +872,7 @@
int num = parseInt(pattern, numBegin, numEnd-numBegin, 10);
 
currentToken = new RETokenBackRef(subIndex,num,insens);
+   if (insensUSASCII) currentToken.unicodeAware = false;
index = numEnd;
   }
 
@@ -904,6 +921,7 @@
   else if (unit.bk && (unit.ch == 'd') && 
syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) {
addToken(currentToken);
currentToken = new 
RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,false);
+   if (insensUSASCII) currentToken.unicodeAware = false;
   }
 
   // NON

[cp-patches] FYI: Removing one not existent method

2006-04-08 Thread Wolfgang Baer
Hi,

this patch removes one method which does not exist in the abstract
SynthPainter class (pointed out by reverse japi).

2006-04-08  Wolfgang Baer  <[EMAIL PROTECTED]>

* javax/swing/plaf/synth/SynthPainter.java:
(paintSplitPaneDividerBorder): Removed.

Wolfgang



Index: javax/swing/plaf/synth/SynthPainter.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/synth/SynthPainter.java,v
retrieving revision 1.3
diff -u -r1.3 SynthPainter.java
--- javax/swing/plaf/synth/SynthPainter.java	22 Mar 2006 20:05:02 -	1.3
+++ javax/swing/plaf/synth/SynthPainter.java	8 Apr 2006 13:46:34 -
@@ -1418,23 +1418,6 @@
   }
 
   /**
-   * Paints the border of a split pane's divider.
-   *
-   * @param ctx the synth context identifying the component and region for
-   *painting
-   * @param g the graphics context to use for painting
-   * @param x the X coordinate of the area to paint
-   * @param y the Y coordinate of the area to paint 
-   * @param w the width of the area to paint
-   * @param h the height of the area to paint
-   */
-  public void paintSplitPaneDividerBorder(SynthContext ctx, Graphics g, int x,
-   int y, int w, int h)
-  {
-// Nothing to do here.
-  }
-
-  /**
* Paints the background of a tabbed pane.
*
* @param ctx the synth context identifying the component and region for


Re: [cp-patches] FYI: More reverse japi fixes

2006-04-08 Thread Wolfgang Baer
Wolfgang Baer wrote:
> Hi,
> 
> this patch moves the initialization of some fields into a
> static initializer so they are no longer constants. Also
> weird thats what the JDK does and is reported by reverse japi.

Sorry, changelogs missed some stuff:

2006-04-08  Wolfgang Baer  <[EMAIL PROTECTED]>

* javax/swing/plaf/basic/BasicInternalFrameTitlePane.java:
(CLOSE_CMD, ICONIFY_CMD, MAXIMIZE_CMD, MOVE_CMD, RESTORE_CMD, SIZE_CMD):
No longer constants.
(static_initializer): Added to initialize above fields.
* javax/accessibility/AccessibleRelation.java (LABEL_FOR, LABELED_BY,
MEMBER_OF, CONTROLLER_FOR, CONTROLLED_BY): No longer constants.
(static_initializer): Added to initialize above fields.

Wolfgang



[cp-patches] FYI: More reverse japi fixes

2006-04-08 Thread Wolfgang Baer
Hi,

this patch moves the initialization of some fields into a
static initializer so they are no longer constants. Also
weird thats what the JDK does and is reported by reverse japi.

2006-04-08  Wolfgang Baer  <[EMAIL PROTECTED]>

* javax/swing/plaf/basic/BasicInternalFrameTitlePane.java:
(CLOSE_CMD, ICONIFY_CMD, MAXIMIZE_CMD, MOVE_CMD, RESTORE_CMD, SIZE_CMD):
No longer constants.
* javax/accessibility/AccessibleRelation.java (LABEL_FOR, LABELED_BY,
MEMBER_OF, CONTROLLER_FOR, CONTROLLED_BY): No longer constants.

Wolfgang

Index: javax/accessibility/AccessibleRelation.java
===
RCS file: /cvsroot/classpath/classpath/javax/accessibility/AccessibleRelation.java,v
retrieving revision 1.4
diff -u -r1.4 AccessibleRelation.java
--- javax/accessibility/AccessibleRelation.java	13 Jul 2005 13:45:00 -	1.4
+++ javax/accessibility/AccessibleRelation.java	8 Apr 2006 13:36:36 -
@@ -61,7 +61,7 @@
* @see #LABELED_BY
* @see #MEMBER_OF
*/
-  public static final String LABEL_FOR = "labelFor";
+  public static final String LABEL_FOR;
 
   /**
* Indicates the object is labeled by other objects.
@@ -72,7 +72,7 @@
* @see #LABEL_FOR
* @see #MEMBER_OF
*/
-  public static final String LABELED_BY = "labeledBy";
+  public static final String LABELED_BY;
 
   /**
* Indicates an object is a member of a group of target objects.
@@ -83,7 +83,7 @@
* @see #LABEL_FOR
* @see #LABELED_BY
*/
-  public static final String MEMBER_OF = "memberOf";
+  public static final String MEMBER_OF;
 
   /**
* Indicates an object is a controller for other objects.
@@ -94,7 +94,7 @@
* @see #LABELED_BY
* @see #MEMBER_OF
*/
-  public static final String CONTROLLER_FOR = "controllerFor";
+  public static final String CONTROLLER_FOR;
 
   /**
* Indicates an object is controlled by other objects.
@@ -105,7 +105,7 @@
* @see #LABELED_BY
* @see #MEMBER_OF
*/
-  public static final String CONTROLLED_BY = "controlledBy";
+  public static final String CONTROLLED_BY;
 
   /** Indicates that the label target group has changed. */
   public static final String LABEL_FOR_PROPERTY = "labelForProperty";
@@ -124,6 +124,16 @@
 
   /** An empty set of targets. */
   private static final Object[] EMPTY_TARGETS = { };
+  
+  static
+{
+  // not constants in JDK
+  LABEL_FOR = "labelFor";
+  LABELED_BY = "labeledBy";
+  MEMBER_OF = "memberOf";
+  CONTROLLER_FOR = "controllerFor";
+  CONTROLLED_BY = "controlledBy";
+}
 
   /**
* The related objects.
Index: javax/swing/plaf/basic/BasicInternalFrameTitlePane.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicInternalFrameTitlePane.java,v
retrieving revision 1.21
diff -u -r1.21 BasicInternalFrameTitlePane.java
--- javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	15 Mar 2006 18:25:05 -	1.21
+++ javax/swing/plaf/basic/BasicInternalFrameTitlePane.java	8 Apr 2006 13:36:36 -
@@ -520,22 +520,22 @@
   }
 
   /** The action command for the Close action. */
-  protected static final String CLOSE_CMD = "Close";
+  protected static final String CLOSE_CMD;
 
   /** The action command for the Minimize action. */
-  protected static final String ICONIFY_CMD = "Minimize";
+  protected static final String ICONIFY_CMD;
 
   /** The action command for the Maximize action. */
-  protected static final String MAXIMIZE_CMD = "Maximize";
+  protected static final String MAXIMIZE_CMD;
 
   /** The action command for the Move action. */
-  protected static final String MOVE_CMD = "Move";
+  protected static final String MOVE_CMD;
 
   /** The action command for the Restore action. */
-  protected static final String RESTORE_CMD = "Restore";
+  protected static final String RESTORE_CMD;
 
   /** The action command for the Size action. */
-  protected static final String SIZE_CMD = "Size";
+  protected static final String SIZE_CMD;
 
   /** The action associated with closing the JInternalFrame. */
   protected Action closeAction;
@@ -614,6 +614,17 @@
* This is package-private to avoid an accessor method.
*/
   transient JLabel title;
+  
+  static
+{
+  // not constants in JDK
+  CLOSE_CMD = "Close";
+  ICONIFY_CMD = "Minimize";
+  MAXIMIZE_CMD = "Maximize";
+  MOVE_CMD = "Move";
+  RESTORE_CMD = "Restore";
+  SIZE_CMD = "Size";
+}
 
   /**
* Creates a new BasicInternalFrameTitlePane object that is used in the


Re: [cp-patches] RFC: Dialog fixlets and documentation

2006-04-08 Thread Wolfgang Baer
Mark Wielaard wrote:
> Hi Wolfgang,
> 
> On Fri, 2006-04-07 at 21:29 +0200, Wolfgang Baer wrote:
>> 2006-04-07  Wolfgang Baer  <[EMAIL PROTECTED]>
>>
>>  * java/awt/Dialog.java: Improved documentation all over.
>>  (Dialog(Frame)): If gc is null use the owners GraphicsConfiguration.
>>  (Dialog(Dialog)): Likewise.
>>
>> OK to commit ?
> 
> Yes, this looks fine to me.

Committed.

Thanks,
Wolfgang




Re: [cp-patches] RFC: Dialog fixlets and documentation

2006-04-08 Thread Mark Wielaard
Hi Wolfgang,

On Fri, 2006-04-07 at 21:29 +0200, Wolfgang Baer wrote:
> 2006-04-07  Wolfgang Baer  <[EMAIL PROTECTED]>
> 
>   * java/awt/Dialog.java: Improved documentation all over.
>   (Dialog(Frame)): If gc is null use the owners GraphicsConfiguration.
>   (Dialog(Dialog)): Likewise.
> 
> OK to commit ?

Yes, this looks fine to me.

Thanks,

Mark


signature.asc
Description: This is a digitally signed message part


Re: [cp-patches] Patch: FYI: core bug patrol

2006-04-08 Thread Mark Wielaard
Hi Tom,

On Fri, 2006-04-07 at 13:38 -0600, Tom Tromey wrote:
> This fixes a number of warnings that have crept into the Classpath
> core recently... basically javadoc and serialization stuff.

Cool! Tell us more!
What is the Classpath core?
How do you do the patrols?
Can someone else do patrols for other non-core parts?

Cheers,

Mark


signature.asc
Description: This is a digitally signed message part


Re: [cp-patches] PATCH: PR 24464

2006-04-08 Thread Mark Wielaard
Hi,

On Fri, 2006-04-07 at 23:43 -0700, Casey Marshall wrote:
> This changes the Jar file implementation to always query the `Gnu'  
> provider when getting cryptographic algorithms, by creating a new  
> instance of the provider, and passing that to `getInstance.' This  
> ensures that we will always get the right algorithm, even if the GNU  
> provider is removed from the providers list.

Nice catch. I have one issue with the patch and that is that it
allocates a new Gnu provider each time when verifying an element and
that creates a new Hashtable each time that gets filled with all the
algorithms supported. But Provider is thread safe and we don't even
change the state of it so we can just reuse one instance.

2006-04-08  Mark Wielaard  <[EMAIL PROTECTED]>

* java/util/jar/JarFile.java (provider): New static field.
(verify, verifyHashes, EntryInputStream.): Pass provider
to `getInstance.'

Committed,

Mark
Index: java/util/jar/JarFile.java
===
RCS file: /cvsroot/classpath/classpath/java/util/jar/JarFile.java,v
retrieving revision 1.20
diff -u -r1.20 JarFile.java
--- java/util/jar/JarFile.java	8 Apr 2006 06:42:37 -	1.20
+++ java/util/jar/JarFile.java	8 Apr 2006 11:15:09 -
@@ -1,5 +1,5 @@
 /* JarFile.java - Representation of a jar file
-   Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -106,6 +106,13 @@
   /** The suffix for signature files. */
   private static final String SF_SUFFIX = ".SF";
 
+  /**
+   * The security provider to use for signature verification.
+   * We need a known fallback to be able to read any signed jar file
+   * (which might contain the user selected security provider).
+   */
+  private static final Gnu provider = new Gnu();
+
   // Signature OIDs.
   private static final OID MD2_OID = new OID("1.2.840.113549.2.2");
   private static final OID MD4_OID = new OID("1.2.840.113549.2.4");
@@ -632,7 +639,6 @@
 Signature sig = null;
 try
   {
-Gnu provider = new Gnu ();
 OID alg = signerInfo.getDigestEncryptionAlgorithmId();
 if (alg.equals(DSA_ENCRYPTION_OID))
   {
@@ -758,7 +764,7 @@
 try
   {
 byte[] hash = Base64InputStream.decode((String) e.getValue());
-MessageDigest md = MessageDigest.getInstance(alg, new Gnu ());
+MessageDigest md = MessageDigest.getInstance(alg, provider);
 md.update(entryBytes);
 byte[] hash2 = md.digest();
 if (DEBUG)
@@ -941,9 +947,9 @@
   hashes.add(Base64InputStream.decode((String) e.getValue()));
   try
 {
-  md.add(MessageDigest.getInstance
- (key.substring(0, key.length() - DIGEST_KEY_SUFFIX.length()),
-  new Gnu ()));
+  int length = key.length() - DIGEST_KEY_SUFFIX.length();
+  String alg = key.substring(0, length);
+  md.add(MessageDigest.getInstance(alg, provider));
 }
   catch (NoSuchAlgorithmException nsae)
 {


signature.asc
Description: This is a digitally signed message part


[cp-patches] FYI: StackTraceElement.toString() tweak

2006-04-08 Thread Mark Wielaard
Hi,

The following was needed to let eclipse parse the output of our
Throwable.printStackTrace() implementation. It is a little bogus that
eclipse tries to do that, but I didn't see why we wouldn't be compatible
with it (and our printStackTrace() documentation actually didn't include
the space in the first place).

2006-04-08  Mark Wielaard  <[EMAIL PROTECTED]>

   PR 27081
   * java/lang/StackTraceElement.java (toString): Don't add space
   between type and source indicator.

Committed,

Mark
Index: java/lang/StackTraceElement.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/StackTraceElement.java,v
retrieving revision 1.8
diff -u -r1.8 StackTraceElement.java
--- java/lang/StackTraceElement.java	26 Nov 2005 22:21:26 -	1.8
+++ java/lang/StackTraceElement.java	8 Apr 2006 10:43:27 -
@@ -1,5 +1,5 @@
 /* StackTraceElement.java -- One function call or call stack element
-   Copyright (C) 2001, 2002, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2004, 2005, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -211,7 +211,7 @@
   }
 if (methodName != null)
   sb.append(methodName);
-sb.append(" (");
+sb.append("(");
 if (fileName != null)
   sb.append(fileName);
 else


signature.asc
Description: This is a digitally signed message part