Re: [cp-patches] RFC: Remove default 'Expect 100-continue' usage in HTTP Requests

2006-02-09 Thread Wolfgang Baer
Wolfgang Baer wrote:
 Hi,
 
 this patch removes the default 'Expect 100-continue' usage if the content
 length exceeds a certain treshold (by default 4096 bytes). There is still
 support that user intended 'Expect 100-continue' headers will work. The
 background for this patch was explained in another thread:
 
 http://thread.gmane.org/gmane.comp.java.classpath.patches/6658
 
 I verified that SUN also never uses 'Expect 100-continue' without user 
 setting.
 
 The change makes a field and its setter method useless and they are removed.
 
 2006-02-03  Wolfgang Baer  [EMAIL PROTECTED]
 
   * gnu/java/net/protocol/http/Request.java:
   (Request): Remove initialization of removed field.
   (requestBodyNegotiationThreshold): Removed now unused field.
   (setRequestBodyNegotiationThreshold): Remove now unused method.
   (dispatch): Do not use 'Expect 100-continue' header if content-length
   is over a treshold. If user specified 'Expect 100-continue' still
   initialize the expectingContinue variable.
 
 OK to commit ?

Committed without changes (except changelog date), as nothing else came up
and David's only concern with the equals comparision was resolved.

Wolfgang



Re: [cp-patches] RFC: Adding missing IllegalState and null value checks to HTTPURLConnection

2006-02-09 Thread Wolfgang Baer
Wolfgang Baer wrote:
 Hi,
 
 this patch adds missing checks for already connected and a special treatment
 of null in getRequestProperty. This makes the yesterday committed mauve
 testcases  illegalStateException and nullPointerException and
 getRequestProperty pass.
 
 2006-02-05  Wolfgang Baer  [EMAIL PROTECTED]
 
   * java/net/URLConnection.java:
   (setAllowUserInteraction): Throw IllegalStateException if connected.
   (getRequestProperty): Document return value if key is null.
   * gnu/java/net/protocol/http/HTTPURLConnection.java:
   (getRequestProperty): Return null if key is null.
   (getRequestProperties): Throw IllegalStateException if connected.
   (setRequestProperty): Call super method for exception tests.
   (addRequestProperty): Likewise.
 

Committed without changes (except changelog date)

Wolfgang



[cp-patches] FYI: Added ASN.1 encoding/decoding support to RSA keys

2006-02-09 Thread Raif S. Naffah
hello there,

the attached patch --already committed-- adds ASN.1 encoding and 
decoding capabilities to the RSA key-pair implementation.

2006-02-09  Raif S. Naffah  [EMAIL PROTECTED]

* gnu/java/security/key/rsa/RSAKeyPairX509Codec.java: New file.
* gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java: Likewise.
* gnu/java/security/key/rsa/RSAKeyPairGenerator.java
(PREFERRED_ENCODING_FORMAT): New constant.
(DEFAULT_ENCODING_FORMAT): Likewise.
(preferredFormat): New field.
(setup): Add support for preferred encoding format.
(generate): Call key constructors with explicit format identifier.
* gnu/java/security/key/rsa/GnuRSAPublicKey.java (GnuRSAPublicKey(2)): 
Call constructor with 3 arguments..
(GnuRSAPublicKey(3)): New constructor.
(valueOf): Added support for ASN.1 format.
(getEncoded): Likewise.
* gnu/java/security/key/rsa/GnuRSAPrivateKey.java 
(GnuRSAPrivateKey(4)):
Call constructor with 5 arguments.
(GnuRSAPrivateKey(5)): New constructor.
(GnuRSAPrivateKey(9)): New constructor.
(valueOf): Added support for ASN.1 format.
(getEncoded): Likewise.
* gnu/java/security/key/rsa/GnuRSAKey.java (defaultFormat): New field.
(GnuRSAKey): Modified constructor.
(getFormat): Return preferred format identifier.
* gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java
(decodePrivateKey): Fixed documentation.
Check Version field.
* gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java
(initialize(int,SecureRandom)): Set ASN.1 as the preferred encoding
format.
(initialize(AlgorithmParameterSpec,SecureRandom)): Likewise.
* gnu/java/security/jce/sig/EncodedKeyFactory.java
(engineGeneratePublic): Added support for RSA.
(engineGeneratePrivate): Likewise.


cheers;
rsn
Index: EncodedKeyFactory.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java,v
retrieving revision 1.1
diff -u -r1.1 EncodedKeyFactory.java
--- EncodedKeyFactory.java	7 Feb 2006 12:06:48 -	1.1
+++ EncodedKeyFactory.java	9 Feb 2006 11:45:50 -
@@ -41,6 +41,8 @@
 import gnu.java.security.Registry;
 import gnu.java.security.key.dss.DSSPrivateKey;
 import gnu.java.security.key.dss.DSSPublicKey;
+import gnu.java.security.key.rsa.GnuRSAPrivateKey;
+import gnu.java.security.key.rsa.GnuRSAPublicKey;

 import java.security.InvalidKeyException;
 import java.security.InvalidParameterException;
@@ -79,7 +81,14 @@
   {
   }

-// FIXME: try RSA
+// try RSA
+try
+{
+  return GnuRSAPublicKey.valueOf(input);
+}
+  catch (InvalidParameterException ignored)
+{
+}

 // FIXME: try DH

@@ -103,7 +112,14 @@
   {
   }

-// FIXME: try RSA
+// try RSA
+try
+{
+  return GnuRSAPrivateKey.valueOf(input);
+}
+  catch (InvalidParameterException ignored)
+{
+}

 // FIXME: try DH

Index: RSAKeyPairGeneratorSpi.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java,v
retrieving revision 1.1
diff -u -r1.1 RSAKeyPairGeneratorSpi.java
--- RSAKeyPairGeneratorSpi.java	26 Jan 2006 02:25:10 -	1.1
+++ RSAKeyPairGeneratorSpi.java	9 Feb 2006 11:46:24 -
@@ -1,4 +1,4 @@
-/* RSAKeyPairGeneratorSpi.java --
+/* RSAKeyPairGeneratorSpi.java -- JCE RSA KeyPairGenerator Adapter
Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.

 This file is a part of GNU Classpath.
@@ -84,6 +84,8 @@
 attributes.put(RSAKeyPairGenerator.SOURCE_OF_RANDOMNESS, random);
   }

+attributes.put(RSAKeyPairGenerator.PREFERRED_ENCODING_FORMAT,
+   new Integer(Registry.ASN1_ENCODING_ID));
 adaptee.setup(attributes);
   }

@@ -106,6 +108,8 @@
 attributes.put(RSAKeyPairGenerator.SOURCE_OF_RANDOMNESS, random);
   }

+attributes.put(RSAKeyPairGenerator.PREFERRED_ENCODING_FORMAT,
+   new Integer(Registry.ASN1_ENCODING_ID));
 adaptee.setup(attributes);
   }
 }
Index: DSSKeyPairPKCS8Codec.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java,v
retrieving revision 1.1
diff -u -r1.1 DSSKeyPairPKCS8Codec.java
--- DSSKeyPairPKCS8Codec.java	7 Feb 2006 12:06:48 -	1.1
+++ DSSKeyPairPKCS8Codec.java	9 Feb 2006 11:46:50 -
@@ -177,7 +177,7 @@

   /**
* @param input the byte array to unmarshall into a valid DSS
-   *  [EMAIL PROTECTED] PublicKey} instance. MUST NOT be null.
+   *  [EMAIL PROTECTED] PrivateKey} instance. MUST NOT be null.
* @return a new instance of a [EMAIL PROTECTED] DSSPrivateKey} decoded from the
* iPrivateKeyInfo/i material fed as 

[cp-patches] RFC: GtkScrollbarPeer min == max

2006-02-09 Thread Mark Wielaard
Hi,

gtk_range_set_range doesn't allow setting min == max. But Scrollbar does
allow that. The following patch makes sure that we set max to be bigger
than min and make sure that the page_size is at least max - min so to
the user it just looks like a scrollbar that cannot be adjusted (this
works because the actual max value of the scrollbar is max - page_size).

2006-02-09  Mark Wielaard  [EMAIL PROTECTED]

* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Make sure max is
creater than min, adjusting page_size if necessary.
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues): Likewise.

Does this look sane?

Cheers,

Mark
? native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c.unlocked
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c
===
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c,v
retrieving revision 1.2
diff -u -r1.2 gnu_java_awt_peer_gtk_GtkScrollbarPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c	14 Jul 2005 22:07:02 -	1.2
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c	9 Feb 2006 12:37:22 -
@@ -86,6 +86,14 @@
 
   gdk_threads_enter ();
 
+  /* A little hack because gtk_range_set_range() doesn't allow min == max. */
+  if (min == max)
+{
+  if (visible_amount == 0)
+	visible_amount = 1;
+  max++;
+}
+
   adj = gtk_adjustment_new ((gdouble) value,
 (gdouble) min,
 (gdouble) max,
@@ -181,6 +189,14 @@
 
   gdk_threads_enter ();
 
+  /* A little hack because gtk_range_set_range() doesn't allow min == max. */
+  if (min == max)
+{
+  if (visible == 0)
+	visible = 1;
+  max++;
+}
+
   adj = gtk_range_get_adjustment (GTK_RANGE (ptr));
   adj-page_size = (gdouble) visible;
 


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


[cp-patches] FYI: BasicTextUI fixlet

2006-02-09 Thread Roman Kennke
While hacking on text stuff and observing Sun's behaviour I noticed that
View.setSize() is always called before paint() by the RootView. That
makes sense, that makes sure that the layout of a view hierarchy is
updated correctly before painting anything.

2006-02-09  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/plaf/basic/BasicTextUI.java
(RootView.paint): Call setSize() before painting the view.

/Roman
Index: javax/swing/plaf/basic/BasicTextUI.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.66
diff -u -r1.66 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java	7 Feb 2006 15:34:29 -	1.66
+++ javax/swing/plaf/basic/BasicTextUI.java	9 Feb 2006 13:55:35 -
@@ -246,7 +246,11 @@
 public void paint(Graphics g, Shape s)
 {
   if (view != null)
-view.paint(g, s);
+{
+  Rectangle b = s.getBounds();
+  view.setSize(b.width, b.height);
+  view.paint(g, s);
+}
 }
 
 


[cp-patches] FYI: javax.swing.text update

2006-02-09 Thread Roman Kennke
The attached patch fixes a lot of issues with styled text in Swing and
make it more usable with respect to performance and rendering. Try
BeanShell for example.


2006-02-09  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/text/BoxView.java
(myAxis): Made field private.
(xLayoutValid): Replaced by layoutValid array.
(yLayoutValid): Replaced by layoutValid array.
(layoutValid): New field.
(spansX): Replaced by spans array.
(spansY): Replaced by spans array.
(spans): New field.
(offsetsX): Replaced by offsets array.
(offsetsY): Replaced by offsets array.
(offsets): New field.
(requirements): New field.
(BoxView): Initialize new fields.
(layoutChanged): Rewritten to use the layoutValid array.
(isLayoutValid): Rewritten to use the layoutValid array.
(replace): Use the new arrays.
(getPreferredSpan): Rewritten to call calculateXXXRequirements
instead of baselineRequirements.
(baselineRequirements): Rewritten to calculate baseline requirements.
(baselineLayout): Rewritten to calculate baseline layout.
(childAllocation): Use new arrays.
(layout): Rewritten. Only update the layout if necessary.
(layoutMajorAxis): Directly set layoutValid.
(layoutMinorAxis): Directly set layoutValid. Use cached size
requirements.
(getWidth): Use new span array.
(getHeight): Likewise.
(setSize): Rewritten to simply call layout().
(validateLayout): Removed unneeded method.
(getSpan): Use new arrays.
(getOffset): Use new arrays.
(getAlignment): Use cached requirements if possible.
(preferenceChanged): Use new arrays.
* javax/swing/text/FlowView.java
(FlowStrategy.insertUpdate): Do nothing here.
(FlowStrategy.removeUpdate): Do nothing here.
(FlowStrategy.changedUpdate): Do nothing here.
(FlowStrategy.layoutRow): Rewritten.
(FlowStrategy.createView): Rewritten.
(FlowStrategy.adjustRow): New method.
(LogicalView.getViewIndex): Fixed condition for finding child
view.
(layoutDirty): New field indicating the state of the layout.
(FlowView): Initialize new field.
(loadChildren): Set parent on logical view so that preferenceChanges
get propagated upwards.
(layout): Rewritten to match the specs.
(insertUpdate): Set layout to dirty.
(removeUpdate): Set layout to dirty.
(changedUpdate): Set layout to dirty.
* javax/swing/text/GlyphView.java
(getBreakWeight): Rewritten to use the Utilities class. Commented
out though because that is broken.
(insertUpdate): Call preferenceChanged on this object instead of
parent.
* javax/swing/text/ParagraphView.java
(Row.loadChildren): Overridden to be a noop to prevent initial
creation of child views. This is carried out by the flow layout.
* javax/swing/text/View.java
(getPreferredSpan): Added API docs.
(getResizeWeight): Added API docs.
(getMaximumSpan): Added API docs. Rewritten to only have one exit
point.
(getMinimumSpan): Added API docs. Rewritten to return 0 when
resizable instead of Integer.MAX_VALUE.
(getAlignment): Added API docs.
(replace): Added API docs.
(forwardUpdate): Rewritten to only notify child views that need to
be notified.

/Roman
Index: javax/swing/text/BoxView.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/text/BoxView.java,v
retrieving revision 1.12
diff -u -r1.12 BoxView.java
--- javax/swing/text/BoxView.java	17 Nov 2005 20:56:38 -	1.12
+++ javax/swing/text/BoxView.java	9 Feb 2006 14:27:58 -
@@ -58,49 +58,32 @@
   /**
* The axis along which this codeBoxView/code is laid out.
*/
-  int myAxis;
+  private int myAxis;
 
   /**
-   * Indicates wether the layout in X_AXIS is valid.
+   * Indicates if the layout is valid along X_AXIS or Y_AXIS.
*/
-  boolean xLayoutValid;
+  private boolean[] layoutValid = new boolean[2];
 
   /**
-   * Indicates whether the layout in Y_AXIS is valid.
+   * The spans along the X_AXIS and Y_AXIS.
*/
-  boolean yLayoutValid;
+  private int[][] spans = new int[2][];
 
   /**
-   * The spans in X direction of the children.
+   * The offsets of the children along the X_AXIS and Y_AXIS.
*/
-  int[] spansX;
+  private int[][] offsets = new int[2][];
 
   /**
-   * The spans in Y direction of the children.
+   * The size requirements along the X_AXIS and Y_AXIS.
*/
-  int[] spansY;
+  private SizeRequirements[] requirements = new SizeRequirements[2];
 
   /**
-   * The offsets of the children in X direction relative to this BoxView's
-   * inner bounds.
+   * The current span along X_AXIS or Y_AXIS.
*/
-  int[] 

[cp-patches] RFC: gnu.regexp: nested character class expression supported

2006-02-09 Thread Ito Kazumitsu
I think gnu/regexp/RE.java is becoming too big. It would be better
if we could separate RE compiler and matcher. 

2006-02-09  Ito Kazumitsu  [EMAIL PROTECTED]

Fixes bug #26166
* gnu/regexp/RE.java(initialize): Parsing of character class expression
was moved to a new method parseCharClass.
(parseCharClass): New method originally in initialize. Added parsing
of nested character classes.
(ParseCharClassResult): New inner class used as a return value of
parseCharClass.
(getCharExpression),(getNamedProperty): Made static.
* gnu/regexp/RESyntax.java(RE_NESTED_CHARCLASS): New syntax flag.
* gnu/regexp/RETokenOneOf.java(addition): New Vector for storing
nested character classes.
(RETokenOneOf): New constructor accepting the Vector addition.
(getMinimumLength), (getMaximumLength): Returns 1 if the token
stands for only one character.
(match): Added the processing of the Vector addition.
(matchN), (matchP): Do not check next token if addition is used.
Index: classpath/gnu/regexp/RE.java
===
RCS file: /cvsroot/classpath/classpath/gnu/regexp/RE.java,v
retrieving revision 1.17
diff -u -r1.17 RE.java
--- classpath/gnu/regexp/RE.java9 Feb 2006 13:44:59 -   1.17
+++ classpath/gnu/regexp/RE.java9 Feb 2006 14:32:39 -
@@ -1,5 +1,5 @@
 /* gnu/regexp/RE.java
-   Copyright (C) 1998-2001, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -427,116 +427,12 @@
   //  [...] | [^...]
 
   else if ((unit.ch == '[')  !(unit.bk || quot)) {
-   Vector options = new Vector();
-   boolean negative = false;
-   // FIXME: lastChar == 0 means lastChar is not set. But what if
-   // \u is used as a meaningful character?
-   char lastChar = 0;
-   if (index == pLength) throw new 
REException(getLocalizedMessage(unmatched.bracket),REException.REG_EBRACK,index);
-   
-   // Check for initial caret, negation
-   if ((ch = pattern[index]) == '^') {
- negative = true;
- if (++index == pLength) throw new 
REException(getLocalizedMessage(class.no.end),REException.REG_EBRACK,index);
- ch = pattern[index];
-   }
-
-   // Check for leading right bracket literal
-   if (ch == ']') {
- lastChar = ch;
- if (++index == pLength) throw new 
REException(getLocalizedMessage(class.no.end),REException.REG_EBRACK,index);
-   }
-
-   while ((ch = pattern[index++]) != ']') {
- if ((ch == '-')  (lastChar != 0)) {
-   if (index == pLength) throw new 
REException(getLocalizedMessage(class.no.end),REException.REG_EBRACK,index);
-   if ((ch = pattern[index]) == ']') {
- options.addElement(new RETokenChar(subIndex,lastChar,insens));
- lastChar = '-';
-   } else {
- if ((ch == '\\')  
syntax.get(RESyntax.RE_BACKSLASH_ESCAPE_IN_LISTS)) {
-   CharExpression ce = getCharExpression(pattern, index, pLength, 
syntax);
-   if (ce == null)
- throw new REException(invalid escape sequence, 
REException.REG_ESCAPE, index);
-   ch = ce.ch;
-   index = index + ce.len - 1;
- }
- options.addElement(new RETokenRange(subIndex,lastChar,ch,insens));
- lastChar = 0;
- index++;
-   }
-  } else if ((ch == '\\')  
syntax.get(RESyntax.RE_BACKSLASH_ESCAPE_IN_LISTS)) {
-if (index == pLength) throw new 
REException(getLocalizedMessage(class.no.end),REException.REG_EBRACK,index);
-   int posixID = -1;
-   boolean negate = false;
-   // FIXME: asciiEsc == 0 means asciiEsc is not set. But what if
-   // \u is used as a meaningful character?
-char asciiEsc = 0;
-   NamedProperty np = null;
-   if ((dswDSW.indexOf(pattern[index]) != -1)  
syntax.get(RESyntax.RE_CHAR_CLASS_ESC_IN_LISTS)) {
- switch (pattern[index]) {
- case 'D':
-   negate = true;
- case 'd':
-   posixID = RETokenPOSIX.DIGIT;
-   break;
- case 'S':
-   negate = true;
- case 's':
-   posixID = RETokenPOSIX.SPACE;
-   break;
- case 'W':
-   negate = true;
- case 'w':
-   posixID = RETokenPOSIX.ALNUM;
-   break;
- }
-   }
-   if ((pP.indexOf(pattern[index]) != -1)  
syntax.get(RESyntax.RE_NAMED_PROPERTY)) {
- np = getNamedProperty(pattern, index - 1, pLength);
- if (np == null)
-   throw new REException(invalid escape sequence, 
REException.REG_ESCAPE, index);
- index = index - 1 + np.len - 1;
-  

[cp-patches] Patch: GtkPanelPeer and GtkWindowPeer fix

2006-02-09 Thread Lillian Angel
Many test cases I have, show that Sun does not call update(Graphics) on
Panels or Windows. Only paint(Graphics) is called. Many widgets were
being cleared and not repainted properly when update was called.

2006-02-09  Lillian Angel  [EMAIL PROTECTED]

* gnu/java/awt/peer/gtk/GtkPanelPeer.java
(handleEvent): Added code to handle PaintEvent.UPDATE.
Sun does not call update(Graphics g) on Panels.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(handleEvent): New method. Added code to handle 
PaintEvent.UPDATE. Sun does not call update(Graphics g) on 
Panels.

Index: gnu/java/awt/peer/gtk/GtkPanelPeer.java
===
RCS file: /sources/classpath/classpath/gnu/java/awt/peer/gtk/GtkPanelPeer.java,v
retrieving revision 1.19
diff -u -r1.19 GtkPanelPeer.java
--- gnu/java/awt/peer/gtk/GtkPanelPeer.java	2 Jul 2005 20:32:12 -	1.19
+++ gnu/java/awt/peer/gtk/GtkPanelPeer.java	9 Feb 2006 15:38:29 -
@@ -39,8 +39,10 @@
 package gnu.java.awt.peer.gtk;
 
 import java.awt.AWTEvent;
+import java.awt.Graphics;
 import java.awt.Panel;
 import java.awt.event.MouseEvent;
+import java.awt.event.PaintEvent;
 import java.awt.peer.PanelPeer;
 
 public class GtkPanelPeer extends GtkContainerPeer
@@ -63,7 +65,18 @@
 awtComponent.requestFocusInWindow ();
 break;
   }
-super.handleEvent (event);
+
+if (event.getID() == PaintEvent.UPDATE)
+  {
+Graphics g = getGraphics();
+if (!awtComponent.isShowing() || g == null)
+  return;
+
+// Do not want to clear anything before painting.
+awtComponent.paint(g);
+  }
+else
+  super.handleEvent (event);
   }
 
   native void connectSignals ();
Index: gnu/java/awt/peer/gtk/GtkWindowPeer.java
===
RCS file: /sources/classpath/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java,v
retrieving revision 1.42
diff -u -r1.42 GtkWindowPeer.java
--- gnu/java/awt/peer/gtk/GtkWindowPeer.java	16 Nov 2005 15:58:05 -	1.42
+++ gnu/java/awt/peer/gtk/GtkWindowPeer.java	9 Feb 2006 15:38:29 -
@@ -38,9 +38,12 @@
 
 package gnu.java.awt.peer.gtk;
 
+import java.awt.AWTEvent;
 import java.awt.Component;
 import java.awt.Frame;
+import java.awt.Graphics;
 import java.awt.Window;
+import java.awt.event.PaintEvent;
 import java.awt.event.WindowEvent;
 import java.awt.peer.WindowPeer;
 
@@ -235,4 +238,19 @@
 // TODO Auto-generated method stub
 return false;
   }
+  
+  public void handleEvent(AWTEvent event)
+  {
+if (event.getID() == PaintEvent.UPDATE)
+  {
+Graphics g = getGraphics();
+if (!awtComponent.isShowing() || g == null)
+  return;
+
+// Do not want to clear anything before painting.
+awtComponent.paint(g);
+  }
+else
+  super.handleEvent(event);
+  }
 }


Re: [cp-patches] RFC: GtkScrollbarPeer min == max

2006-02-09 Thread Thomas Fitzsimmons
On Thu, 2006-02-09 at 13:37 +0100, Mark Wielaard wrote:
 Hi,
 
 gtk_range_set_range doesn't allow setting min == max. But Scrollbar does
 allow that. The following patch makes sure that we set max to be bigger
 than min and make sure that the page_size is at least max - min so to
 the user it just looks like a scrollbar that cannot be adjusted (this
 works because the actual max value of the scrollbar is max - page_size).
 
 2006-02-09  Mark Wielaard  [EMAIL PROTECTED]
 
 * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c
 (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Make sure max is
 creater than min, adjusting page_size if necessary.
 (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues): Likewise.
 
 Does this look sane?

Yes, this looks fine.

Tom





[cp-patches] RFC: JTable.tableChanged(null)

2006-02-09 Thread Mark Wielaard
Hi,

I got a program here (the hsqldb DatabaseManagerSwing) that expects to
be able to fire null events to a TableModel when everything about the
model has changed. JTable wasn't handling that. Here is a proposed
patch:

2006-02-09  Mark Wielaard  [EMAIL PROTECTED]

* javax/swing/JTable.java (tableChanged): Interpret null event as
everything changed.

OK?

Cheers,

Mark
Index: javax/swing/JTable.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.68
diff -u -r1.68 JTable.java
--- javax/swing/JTable.java	19 Jan 2006 22:22:04 -	1.68
+++ javax/swing/JTable.java	9 Feb 2006 16:23:33 -
@@ -1,5 +1,5 @@
 /* JTable.java -- 
-   Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -1878,22 +1878,22 @@
 
   /**
* Invoked when the table changes.
+   * codenull/code means everything changed.
*/
   public void tableChanged (TableModelEvent event)
   {
 // update the column model from the table model if the structure has
 // changed and the flag autoCreateColumnsFromModel is set
-if ((event.getFirstRow() ==TableModelEvent.HEADER_ROW)
- autoCreateColumnsFromModel)
-
+if ((event == null || (event.getFirstRow() == TableModelEvent.HEADER_ROW))
+	 autoCreateColumnsFromModel)
   createDefaultColumnsFromModel();
 
 // If the structure changes, we need to revalidate, since that might
 // affect the size parameters of the JTable. Otherwise we only need
 // to perform a repaint to update the view.
-if (event.getType() == TableModelEvent.INSERT)
+if (event == null || event.getType() == TableModelEvent.INSERT)
   revalidate();
-else if (event.getType() == TableModelEvent.DELETE)
+if (event == null || event.getType() == TableModelEvent.DELETE)
   {
 if (dataModel.getRowCount() == 0)
   clearSelection();


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


Re: [cp-patches] RFC: JTable.tableChanged(null)

2006-02-09 Thread Roman Kennke
Hi Mark,

Am Donnerstag, den 09.02.2006, 17:31 +0100 schrieb Mark Wielaard:
 Hi,
 
 I got a program here (the hsqldb DatabaseManagerSwing) that expects to
 be able to fire null events to a TableModel when everything about the
 model has changed. JTable wasn't handling that. Here is a proposed
 patch:
 
 2006-02-09  Mark Wielaard  [EMAIL PROTECTED]
 
 * javax/swing/JTable.java (tableChanged): Interpret null event as
 everything changed.
 
 OK?

Looks good.

/Roman



signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


[cp-patches] FYI: DefaultCaret fix

2006-02-09 Thread Roman Kennke
I added some checks and code to make sure the dot location in
DefaultCaret is always valid.

2006-02-09  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/text/DefaultCaret.java
(DocumentHandler.removeUpdate): When update policy is
'on eventqueue', and the update doesn't come from the
event queue, check if the current dot location is still
valid.
(moveDot): Make sure the new dot location is valid.
(setDot): Set the mark the same as the dot.

/Roman
/cvsroot/classpath/classpath/javax/swing/text/DefaultCaret.java,v  --  javax/swing/text/DefaultCaret.java
new revision: 1.30; previous revision: 1.29


Re: [cp-patches] RFC: Time out HTTP keep-alive connections

2006-02-09 Thread David Daney

David Daney wrote:

+class GetPropertiesAction
+  implements PrivilegedAction
+{
+  public Object run()
+  {
+String ttl = System.getProperty(classpath.net.http.keepAliveTTL);
+connectionTTL = (ttl != null  ttl.length()  0) ?
+  1000 * Math.max(1, Integer.parseInt(ttl)) : 1;
+
+String mc = System.getProperty(http.maxConnections);
+maxConnections = (mc != null  mc.length()  0) ?
+  Math.max(Integer.parseInt(mc), 1) : 5;
+if (maxConnections  1)
+  maxConnections =  1;
+return null;
+  }
+}


Well in light of the existence of SystemProperties, I will change this 
part to use it.


I will probably have a follow-on patch to HTTPURLConnection.java to 
convert it to use SystemProperties as well.


David Daney



[cp-patches] FYI: Added rmic code generator to the /tools

2006-02-09 Thread Audrius Meskauskas
This patch adds java.rmi version jdk 1.2+ stub generator to the 
classpath tools package.

Unlike rmic from the cp-tools project (that generates classes but cannot
generate the source code) this version generates only source code that must
be compiled with any java compiler. Source code (rather than binary) output
and template system seems providing the easier maintenance.

The deprecated jdk 1.1 classes are not supporte by this compiler (seems low
priority now).

Unlike cp-tools rmic, this compiler is not dependent on any third party 
libraries.

The common rmic key -iiop forces to delegate work to the previoslu comitted
grmic.

2006-02-09  Audrius Meskauskas  [EMAIL PROTECTED]

   * tools/Makefile.am: Add tools/gnu/classpath/tools/rmi folder.
   * tools/gnu/classpath/tools/giop/GRMIC.txt: Explain it called from RMIC.
   * tools/gnu/classpath/tools/giop/grmic/Generator.java (getResource):
   Better diagnostic.
   * tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java:
   Rewritten.
   * tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java: Implement
   AbstractMethodGenerator.
   * tools/gnu/classpath/tools/AbstractMethodGenerator.java,
   tools/gnu/classpath/tools/rmi/RMIC.java,
   tools/gnu/classpath/tools/rmi/RMIC.txt,
   tools/gnu/classpath/tools/rmi/rmic/RmiMethodGenerator.java,
   tools/gnu/classpath/tools/rmi/rmic/RmicCompiler.java,
   tools/gnu/classpath/tools/rmi/rmic/WrapUnWrapper.java,
   tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12.jav,
   tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12Method.jav,
   tools/gnu/classpath/tools/rmi/rmic/templates/Stub_12MethodVoid.jav:
   New files.
   * NEWS: Corrected entry about the tools.

Index: NEWS
===
RCS file: /sources/classpath/classpath/NEWS,v
retrieving revision 1.108
diff -u -r1.108 NEWS
--- NEWS	8 Feb 2006 12:14:04 -	1.108
+++ NEWS	9 Feb 2006 20:18:15 -
@@ -7,9 +7,10 @@
   `java.security.' `javax.crypto,' and `javax.net.ssl' packages, and
   are service providers implementing the underlying algorithms.
  
- * The new folder tools now contains GIOP tools, providing necessary support
-   for development using org.omg.* and javax.rmi.CORBA.* packages: GIOP
-   stub and tie code generator, IOR parser and naming service.
+* The new folder tools now contains GIOP and RMI tools, providing necessary
+  support for development using org.omg.*, javax.rmi.CORBA.* and java.rmi.* 
+  packages. The toll set includes GIOP and RMI stub and tie code generators,
+  IOR parser and GIOP naming service. 
 
 New in release 0.20 (Jan 13, 2006)
 
Index: tools/Makefile.am
===
RCS file: /sources/classpath/classpath/tools/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- tools/Makefile.am	8 Feb 2006 12:34:19 -	1.3
+++ tools/Makefile.am	9 Feb 2006 20:18:48 -
@@ -29,8 +29,9 @@
 # Extra objects that will not exist until configure-time
 BUILT_SOURCES = $(TOOLS_ZIP)
 
-# the templates that must be included into the generated zip file
-TOOLS_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
+# The templates that must be included into the generated zip file.
+# This covers both tools/giop/grmic/templates and tools/rmi/rmic/templates:
+TOOLS_TEMPLATES = $(srcdir)/gnu/classpath/tools/*/*/templates/*.jav
 TOOLS_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
 
 # The tool specific README files.
@@ -88,7 +89,7 @@
 # And copy the template files we use to the classes dir so they get also included.
 $(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
 	mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
-	cp $(TOOLS_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
+	cp $(TOOLS_TEMPLATES) classes/gnu/classpath/tools/*/*/templates
 	cp $(TOOLS_HELPS) classes/gnu/classpath/tools/giop/
 	$(JCOMPILER) -d classes $(TOOLS_JAVA_FILES) 
 	(cd classes; \
Index: tools/gnu/classpath/tools/giop/GRMIC.txt
===
RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/giop/GRMIC.txt,v
retrieving revision 1.1
diff -u -r1.1 GRMIC.txt
--- tools/gnu/classpath/tools/giop/GRMIC.txt	8 Feb 2006 07:35:30 -	1.1
+++ tools/gnu/classpath/tools/giop/GRMIC.txt	9 Feb 2006 20:18:48 -
@@ -1,3 +1,4 @@
+GIOP stub and tie generator source code generator for javax.rmi.*, omg.org.*
 
 Copyright 2006 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
@@ -22,5 +23,6 @@
  and class names can include one or more non abstract classes that implement
  Remote and are accessible via current class path.
 
-This tool generates the source code that must be compiled with java compiler. 
+* This tool generates the source code that must be compiled with java compiler. 
+* GRMIC is invoked from RMIC if the -iiop or -giop keys are specified.
 
Index: tools/gnu/classpath/tools/giop/grmic/Generator.java

Re: [cp-patches] RFC: HTTPURLConnection fixlet

2006-02-09 Thread Wolfgang Baer
Hi all,

Wolfgang Baer wrote:
 Hi,
 
 David Daney wrote:

Perhaps make isError() a member of Response  
 
 Yes, I also thought of this. Its in HTTPURLConnection because there is
 already a method isRedirect(Response r). Both should be moved to Response.

Committed as attached. Changes over the previous patch are the move of the
isRedirect() and isError() methods to Response.java.

2006-02-09  Wolfgang Baer  [EMAIL PROTECTED]

* gnu/java/net/protocol/http/HTTPURLConnection.java:
(isRedirect): Removed, moved to Response.java.
(connect): If error condition redirect responseSink to errorSink.
(getInputStream): If error condition throw IOException, for the error
codes 404 and 410 throw a FileNotFoundException.
* gnu/java/net/protocol/http/Response.java (isError): New method.
(isRedirect): New method, moved from HTTPURLConnection.java.

Wolfgang


Index: gnu/java/net/protocol/http/HTTPURLConnection.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java,v
retrieving revision 1.18
diff -u -r1.18 HTTPURLConnection.java
--- gnu/java/net/protocol/http/HTTPURLConnection.java	9 Feb 2006 09:37:08 -	1.18
+++ gnu/java/net/protocol/http/HTTPURLConnection.java	9 Feb 2006 20:39:42 -
@@ -254,7 +254,7 @@
   }
   }
 
-if (isRedirect(response)  getInstanceFollowRedirects())
+if (response.isRedirect()  getInstanceFollowRedirects())
   {
 	// Read the response body, if there is one.  If the
 	// redirect points us back at the same server, we will use
@@ -349,22 +349,13 @@
   {
 responseSink = response.getBody();
 
-if (response.getCode() == 404)
-	  {
-		errorSink = responseSink;
-		throw new FileNotFoundException(url.toString());
-	  }
+if (response.isError())
+	  errorSink = responseSink;
   }
   }
 while (retry);
 connected = true;
-  }
-
-  private static boolean isRedirect(Response response)
-  {
-int sc = response.getCode();
-return (sc != 304  (sc / 100) == 3);
-  }
+  }  
 
   /**
* Returns a connection, from the pool if necessary.
@@ -525,6 +516,17 @@
   {
 throw new ProtocolException(doInput is false);
   }
+
+if (response.isError())
+  {
+int code = response.getCode();
+if (code == 404 || code == 410)
+  throw new FileNotFoundException(url.toString());
+  
+throw new IOException(Server returned HTTP response code  + code
+  +  for URL  + url.toString());
+  }
+
 return responseSink;
   }
 
Index: gnu/java/net/protocol/http/Response.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/net/protocol/http/Response.java,v
retrieving revision 1.3
diff -u -r1.3 Response.java
--- gnu/java/net/protocol/http/Response.java	12 Oct 2005 19:48:25 -	1.3
+++ gnu/java/net/protocol/http/Response.java	9 Feb 2006 20:39:42 -
@@ -1,5 +1,5 @@
 /* Response.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -188,6 +188,28 @@
   {
 return headers.getDateValue(name);
   }
+  
+  /**
+   * Tests whether this response indicates a redirection.
+   * 
+   * @return codetrue/code if, codefalse/code otherwise.
+   */
+  public boolean isRedirect()
+  {
+return (code != 304  getCodeClass() == 3);
+  }
+  
+  /**
+   * Tests whether this response indicates an error.
+   * Errors are the response codes code4xx/code - Client error and
+   * code5xx/code - Server error.
+   * 
+   * @return codetrue/code if, codefalse/code otherwise.
+   */
+  public boolean isError()
+  {
+return (getCodeClass() == 4 || getCodeClass() == 5);
+  }
 
   /**
* Returns an InputStream that returns the body of the response.


Re: [cp-patches] RFC: HTTPURLConnection fixlet

2006-02-09 Thread David Daney

Wolfgang Baer wrote:

Hi all,

Wolfgang Baer wrote:


Hi,

David Daney wrote:

Perhaps make isError() a member of Response  


Yes, I also thought of this. Its in HTTPURLConnection because there is
already a method isRedirect(Response r). Both should be moved to Response.



Committed as attached. Changes over the previous patch are the move of the
isRedirect() and isError() methods to Response.java.

2006-02-09  Wolfgang Baer  [EMAIL PROTECTED]

* gnu/java/net/protocol/http/HTTPURLConnection.java:
(isRedirect): Removed, moved to Response.java.
(connect): If error condition redirect responseSink to errorSink.
(getInputStream): If error condition throw IOException, for the error
codes 404 and 410 throw a FileNotFoundException.
* gnu/java/net/protocol/http/Response.java (isError): New method.
(isRedirect): New method, moved from HTTPURLConnection.java.

Wolfgang


Thanks, please update: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26081 
as appropriate.


If this fixes that bug (which I think it does) the changelog should be 
prefixed with 'PR classpath/26081'


David Daney




Re: [cp-patches] RFC: HTTPURLConnection fixlet

2006-02-09 Thread Wolfgang Baer
David Daney wrote:
 Thanks, please update: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26081
 as appropriate.
 
 If this fixes that bug (which I think it does) the changelog should be
 prefixed with 'PR classpath/26081'

Sorry forgot to include this in the changelog - I have updated it now.
Details are added to the bug report - however I have no bug manipulation
rights so its not yet marked as fixed.

Wolfgang



Re: [cp-patches] RFC: HTTPURLConnection fixlet

2006-02-09 Thread David Daney

Wolfgang Baer wrote:

David Daney wrote:


Thanks, please update: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26081
as appropriate.

If this fixes that bug (which I think it does) the changelog should be
prefixed with 'PR classpath/26081'



Sorry forgot to include this in the changelog - I have updated it now.
Details are added to the bug report - however I have no bug manipulation
rights so its not yet marked as fixed.



I think the preferred form would be the exact string:

 'PR classpath/26081'

But it looks like many forms are used in classpath, so I would just 
leave it as is.


I will close the PR.

Thanks,
David Daney.



[cp-patches] FYI: SpinnerDateModel/SpinnerNumberModel.java - removed tabs

2006-02-09 Thread David Gilbert
I committed this patch to remove tabs from two files, these mess up the source code 
output in the gjdoc-generated API documentation:


2006-02-09  David Gilbert  [EMAIL PROTECTED]

* javax/swing/SpinnerDateModel.java: Removed tabs,
* javax/swing/SpinnerNumberModel.java: Likewise.

Regards,

Dave
Index: javax/swing/SpinnerDateModel.java
===
RCS file: /sources/classpath/classpath/javax/swing/SpinnerDateModel.java,v
retrieving revision 1.4
diff -u -r1.4 SpinnerDateModel.java
--- javax/swing/SpinnerDateModel.java   8 Feb 2006 16:54:51 -   1.4
+++ javax/swing/SpinnerDateModel.java   9 Feb 2006 22:31:41 -
@@ -158,7 +158,7 @@
 Date nextDate = nextCal.getTime();
 if (end != null)
   if (end.compareTo(nextDate)  0)
-   return null;
+return null;
 return nextDate;
   }
 
@@ -193,8 +193,8 @@
 
 if (this.calendarField != calendarField)
   {
-   this.calendarField = calendarField;
-   fireStateChanged();
+this.calendarField = calendarField;
+fireStateChanged();
   }
   }
 
@@ -208,8 +208,8 @@
   {
 if (this.start != start)
   {
-   this.start = start;
-   fireStateChanged();
+this.start = start;
+fireStateChanged();
   }
   }
 
@@ -223,8 +223,8 @@
   {
 if (this.end != end)
   {
-   this.end = end;
-   fireStateChanged();
+this.end = end;
+fireStateChanged();
   }
   }
 
Index: javax/swing/SpinnerNumberModel.java
===
RCS file: /sources/classpath/classpath/javax/swing/SpinnerNumberModel.java,v
retrieving revision 1.8
diff -u -r1.8 SpinnerNumberModel.java
--- javax/swing/SpinnerNumberModel.java 8 Feb 2006 21:46:25 -   1.8
+++ javax/swing/SpinnerNumberModel.java 9 Feb 2006 22:31:42 -
@@ -128,13 +128,13 @@
   throw new IllegalArgumentException(value may not be null);
 if (minimum != null)
   {
-   if (minimum.compareTo(value)  0)
- throw new IllegalArgumentException(minimum is not = value);
+if (minimum.compareTo(value)  0)
+  throw new IllegalArgumentException(minimum is not = value);
   }
 if (maximum != null)
   {
-   if (maximum.compareTo(value)  0)
- throw new IllegalArgumentException(maximum is not = value);
+if (maximum.compareTo(value)  0)
+  throw new IllegalArgumentException(maximum is not = value);
   }
 
 this.value = value;
@@ -244,8 +244,8 @@
   {
 if (minimum != null ? !minimum.equals(newMinimum) : newMinimum != null)
   {
-   minimum = newMinimum;
-   fireStateChanged();
+minimum = newMinimum;
+fireStateChanged();
   }
   }
 
@@ -258,8 +258,8 @@
   {
 if (maximum != null ? !maximum.equals(newMaximum) : newMaximum != null)
   {
-   maximum = newMaximum;
-   fireStateChanged();
+maximum = newMaximum;
+fireStateChanged();
   }
   }
 
@@ -275,8 +275,8 @@
 
 if (!stepSize.equals(newStepSize))
   {
-   stepSize = newStepSize;
-   fireStateChanged();
+stepSize = newStepSize;
+fireStateChanged();
   }
   }
 }


[cp-patches] FYI: Tools build correction

2006-02-09 Thread Audrius Meskauskas

2006-02-09  Audrius Meskauskas  [EMAIL PROTECTED]

tools/makefile.am: Handle rmi and giop folders separately.
Index: Makefile.am
===
RCS file: /sources/classpath/classpath/tools/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- Makefile.am	9 Feb 2006 20:22:07 -	1.4
+++ Makefile.am	9 Feb 2006 23:07:59 -
@@ -30,9 +30,16 @@
 BUILT_SOURCES = $(TOOLS_ZIP)
 
 # The templates that must be included into the generated zip file.
-# This covers both tools/giop/grmic/templates and tools/rmi/rmic/templates:
-TOOLS_TEMPLATES = $(srcdir)/gnu/classpath/tools/*/*/templates/*.jav
-TOOLS_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
+GRMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav 
+RMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/rmi/rmic/templates/*.jav
+
+TOOLS_TEMPLATES = $(GRMIC_TEMPLATES) $(RMIC_TEMPLATES)
+
+# This covers the built-in help texts, both for giop and rmic subpackages.
+GIOP_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
+RMI_HELPS = $(srcdir)/gnu/classpath/tools/rmi/*.txt
+
+TOOLS_HELPS = $(GIOP_HELPS) $(RMI_HELPS)
 
 # The tool specific README files.
 READMES = $(srcdir)/gnu/classpath/tools/giop/README
@@ -89,8 +96,11 @@
 # And copy the template files we use to the classes dir so they get also included.
 $(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
 	mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
-	cp $(TOOLS_TEMPLATES) classes/gnu/classpath/tools/*/*/templates
-	cp $(TOOLS_HELPS) classes/gnu/classpath/tools/giop/
+	mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
+	cp $(RMIC_TEMPLATES) classes/gnu/classpath/tools/rmi/rmic/templates
+	cp $(GRMIC_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates	
+	cp $(RMI_HELPS) classes/gnu/classpath/tools/rmi/
+	cp $(GIOP_HELPS) classes/gnu/classpath/tools/giop/
 	$(JCOMPILER) -d classes $(TOOLS_JAVA_FILES) 
 	(cd classes; \
 	if test $(ZIP) != ; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \


[cp-patches] FYI: More styled text

2006-02-09 Thread Roman Kennke
Some more robustness, correctness and completeness fixes for
javax.swing.text Views.

This corrects a misinterpretation in modelToView. We have been throwing
BadLocationExceptions when the position is outside of the view's
bounds. However, this should really only be thrown if the position is
outside the document's bounds and for all other cases return something
reasonable (like the left or right edge of that view, like implemented
in CompositeView).

I also added some missing methods in BoxView. This includes some methods
that should (according to the specs) be overridden but were not. I added
these methods too and tagged them with a FIXME, so that it is more
obvious that there might be a problem.

2006-02-09  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/text/BoxView.java
(getAxis): Added @since tag.
(setAxis): Added @since tag.
(layoutChanged): Added @since tag.
(isLayoutValid): Added @since tag.
(paint): Don't call setSize here. This is done in RootView already.
(getMaximumSpan): Reimplemented to return the requirements'
maximum size. Added API docs.
(getMinimumSpan): New method.
(layout): Fixed layout order.
(modelToView): Call layout instead of setSize here.
(getResizeWeight): New method.
(getChildAllocation): New method.
(forwardUpdate): New method.
(viewToModel): New method.
(flipEastEndWestEnds): New method.
* javax/swing/text/CompositeView.java
(modelToView): Made this method more robust by returning a default
location if it's not possible to calculate one via the children.
This default location returns the left or right edge of this
view.
(createDefaultLocation): New helper method.
* javax/swing/text/IconView.java
(modelToView): Don't throw BadLocationException. This should
really only be thrown if the position is outside the document
model, not if it's outside the view's boundary.

/Roman
Index: javax/swing/text/BoxView.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/text/BoxView.java,v
retrieving revision 1.13
diff -u -r1.13 BoxView.java
--- javax/swing/text/BoxView.java	9 Feb 2006 14:28:49 -	1.13
+++ javax/swing/text/BoxView.java	9 Feb 2006 23:11:49 -
@@ -43,6 +43,7 @@
 import java.awt.Shape;
 
 import javax.swing.SizeRequirements;
+import javax.swing.event.DocumentEvent;
 
 /**
  * An implementation of [EMAIL PROTECTED] CompositeView} that arranges its children in
@@ -115,6 +116,8 @@
* Returns the axis along which this codeBoxView/code is laid out.
*
* @return the axis along which this codeBoxView/code is laid out
+   *
+   * @since 1.3
*/
   public int getAxis()
   {
@@ -128,6 +131,8 @@
* [EMAIL PROTECTED] View#Y_AXIS}.
*
* @param axis the axis along which this codeBoxView/code is laid out
+   *
+   * @since 1.3
*/
   public void setAxis(int axis)
   {
@@ -147,6 +152,8 @@
* [EMAIL PROTECTED] View#Y_AXIS}.
*
* @param axis an codeint/code value
+   *
+   * @since 1.3
*/
   public void layoutChanged(int axis)
   {
@@ -166,6 +173,8 @@
*
* @return codetrue/code if the layout along the specified
* codeaxis/code is valid, codefalse/code otherwise
+   *
+   * @since 1.4
*/
   protected boolean isLayoutValid(int axis)
   {
@@ -264,12 +273,6 @@
*/
   public void paint(Graphics g, Shape a)
   {
-// Adjust size if the size is changed.
-Rectangle bounds = a.getBounds();
-
-if (bounds.width != getWidth() || bounds.height != getHeight())
-  setSize(bounds.width, bounds.height);
-
 Rectangle inside = getInsideAllocation(a);
 Rectangle copy = new Rectangle(inside);
 int count = getViewCount();
@@ -305,12 +308,54 @@
 return requirements[axis].preferred;
   }
 
+  /**
+   * Returns the maximum span of this view along the specified axis.
+   * This calculates the maximum span using
+   * [EMAIL PROTECTED] #calculateMajorAxisRequirements} or
+   * [EMAIL PROTECTED] #calculateMinorAxisRequirements} (depending on the axis) and
+   * returns the resulting maximum span.
+   *
+   * @param axis the axis
+   *
+   * @return the maximum span of this view along the specified axis
+   */
   public float getMaximumSpan(int axis)
   {
-if (axis == getAxis())
-  return getPreferredSpan(axis);
-else
-  return Integer.MAX_VALUE;
+if (!isLayoutValid(axis))
+  {
+if (axis == myAxis)
+  requirements[axis] = calculateMajorAxisRequirements(axis,
+   requirements[axis]);
+else
+  requirements[axis] = calculateMinorAxisRequirements(axis,
+   requirements[axis]);
+  }
+return requirements[axis].maximum;
+  }
+
+  /**
+   * Returns the minimum span of this view along 

[cp-patches] RFC: Don't unnecessary double queue GtkComponentPeer.repaint() events

2006-02-09 Thread Mark Wielaard
Hi,

While debugging some awt gtk+ peer issues I noticed that we always route
repaint events through 2 queues. First we create a Timer and put it in
there. Second we put it in the actual system event queue. If the repaint
is requested immediately that is overkill. And looking at a couple of
sample programs it looks like delayed repaints are not that often
requested at all. So this patch defers the creation of the Timer till
the first time a delayed repaint request is actually made. And it
immediately posts the repaint event to the system event queue if no
delay is asked for.

2006-02-09  Mark Wielaard  [EMAIL PROTECTED]

* gnu/java/awt/peer/gtk/GtkComponentPeer.java (repaintTimer):
Removed field.
(repaint): Immediately post to queue when tm = 0, otherwise call
RepaintTimerTask.schedule().
(RepaintTimerTask): Make static.
(RepaintTimerTask.repaintTimer): New static final field.
(RepaintTimerTask.awtComponent): New field.
(schedule): New static method.

OK to commit?

Cheers,

Mark
Index: gnu/java/awt/peer/gtk/GtkComponentPeer.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java,v
retrieving revision 1.101
diff -u -r1.101 GtkComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkComponentPeer.java	9 Feb 2006 17:44:30 -	1.101
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java	9 Feb 2006 23:29:38 -
@@ -1,5 +1,6 @@
 /* GtkComponentPeer.java -- Implements ComponentPeer with GTK
-   Copyright (C) 1998, 1999, 2002, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2002, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -87,8 +88,6 @@
 
   boolean isInRepaint;
 
-  static final Timer repaintTimer = new Timer (true);
-
   /* this isEnabled differs from Component.isEnabled, in that it
  knows if a parent is disabled.  In that case Component.isEnabled 
  may return true, but our isEnabled will always return false */
@@ -383,19 +389,32 @@
 if (x == 0  y == 0  width == 0  height == 0)
   return;
 
-repaintTimer.schedule(new RepaintTimerTask(x, y, width, height), tm);
+System.err.println(UPDATE:  + awtComponent);
+Thread.dumpStack();
+if (tm = 0)
+  q().postEvent(new PaintEvent(awtComponent, PaintEvent.UPDATE,
+   new Rectangle(x, y, width, height)));
+else
+  RepaintTimerTask.schedule(tm, x, y, width, height, awtComponent);
   }
 
-  private class RepaintTimerTask extends TimerTask
+  /**
+   * Used for scheduling delayed paint updates on the event queue.
+   */
+  private static class RepaintTimerTask extends TimerTask
   {
+private static final Timer repaintTimer = new Timer(true);
+
 private int x, y, width, height;
+private Component awtComponent;
 
-RepaintTimerTask(int x, int y, int width, int height)
+RepaintTimerTask(Component c, int x, int y, int width, int height)
 {
   this.x = x;
   this.y = y;
   this.width = width;
   this.height = height;
+  this.awtComponent = c;
 }
 
 public void run()
@@ -403,6 +422,12 @@
   q().postEvent (new PaintEvent (awtComponent, PaintEvent.UPDATE,
  new Rectangle (x, y, width, height)));
 }
+
+static void schedule(long tm, int x, int y, int width, int height,
+			 Component c)
+{
+  repaintTimer.schedule(new RepaintTimerTask(c, x, y, width, height), tm);
+}
   }
 
   public void requestFocus ()


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


Re: [cp-patches] FYI: Added rmic code generator to the /tools

2006-02-09 Thread Tom Tromey
 Audrius == Audrius Meskauskas [EMAIL PROTECTED] writes:

Audrius This patch adds java.rmi version jdk 1.2+ stub generator to the
Audrius classpath tools package.

We used to have rmic in classpath.  Then we moved it to
classpath-tools.  Then Archit rewrote it to use ASM instead of having
it generate java source code.

The rewrite was needed for performance.  See the original post:

http://lists.gnu.org/archive/html/classpath/2005-05/msg00085.html

Audrius Source code (rather than binary) output
Audrius and template system seems providing the easier maintenance.

Performance actually turns out to matter more, since this stuff is
used by things like jonas.  Also, emitting bytecode can be readable
and maintainable, it just needs to be done smartly (commented, use a
nice library like ASM), etc.

I'd really prefer we merge the cp-tools stuff back into classpath
proper, and find a way to import and build ASM as part of our build
process.

It seems kind of bad to have two rmic implementations (3 if you count
the fact that the old .java-producing one still lives in libgcj... we
never got around to our own ASM import there).

Tom



Usage of System.getProperty() vs. SystemProperties.getProperty()

2006-02-09 Thread Wolfgang Baer
Hi all,

I am a bit confused when to use the internal SystemProperties.getProperty()
method over the normal System.getProperty() method.

Until now I thought SystemProperties.getProperty() is to be used inside the
internal gnu.* namespace as it should be save here to call without the security
manager enforced. However there is also a lot of usage of the normal
System.getProperty() method.

For example gnu.java.net.protocol.file.Connection uses
SystemProperties.getProperty() to get the line.separator whereas
gnu.java.io.PlatformHelper uses System.getProperty().

Clarifications are welcome :-)

Thanks,
Wolfgang



Re: Classpath on Cgwin: UnsatisfiedLinkError problem

2006-02-09 Thread Dalibor Topic
On Wed, 2006-02-08 at 21:11 -0600, Archie Cobbs wrote:
 S. Meslin-Weber wrote:
  VM writers typically handle the delegated loadLibrary() call via their
  implementation of the VM* interface classes and in their own native
  code.
  
  As cygwin uses a decidedly odd naming convention for its dlls, I'd say
  those parts of jc would need to be investigated. IIRC, Cygwin calles its
  equivalent of libjavanio.so cygjavanio-0.dll.
 
 So... what's an #ifdef one can use on cygwin to detect cygwin?
 E.g. #ifdef WINDOWS or #ifdef CYGWIN or something? (This is hard
 for me to fix right now because I don't have cygwin set up anywhere).
 
 Presumably other VMs have the same issue (if they want to run
 on cygwin). Has anyone already solved this problem?

Yes. See 

2005-09-13  Dalibor Topic  [EMAIL PROTECTED]

* libraries/java/java/lang/Runtime.java
(loadLibrary) Try multiple different
prefixes and suffixes if library can't be loaded
using the mapped name. This takes care of
Cygwin DLLs, Libtool modules and hopefully
will work for dylibs, jnilibs and similar
DSO variants as well.

( http://www.kaffe.org/pipermail/kaffe/2005-September/103250.html )

in Kaffe. If it works for you, we should fold it into VMRuntime, I
guess.

cheers,
dalibor topic




Re: Usage of System.getProperty() vs. SystemProperties.getProperty()

2006-02-09 Thread Gary Benson
Jeroen Frijters wrote:
 Wolfgang Baer wrote:
  I am a bit confused when to use the internal
  SystemProperties.getProperty() method over the normal
  System.getProperty() method.
 
 When writing new code (or modifying existing code) you should almost
 always use SystemProperties.getProperty(). Unless that would be a
 clear security risk and/or it is documented that the method does a
 security check on the property.

 The reason there is still a lot of code that uses System.getProperty()
 is either historical (i.e. SystemProperties was introduced after
 that code was written) or because the author was unaware of
 SystemProperties.  We've not been as careful about this as we maybe
 should be.

The Mauve tests I am writing should cover every method that's
documented as performing security tests on a property, so don't
worry about accidentally writing something insecure: I ought to
catch it in the next few weeks.

Cheers,
Gary



GtkComponentPeer realization

2006-02-09 Thread Mark Wielaard
Hi,

After a lot of debugging I finally found out why a program I was testing
was crashing sometimes. (The hsqldb AWT frontend - try the
org.hsqldb.util.DatabaseManager class from the hsqldb.jar as distributed
with OpenOffice for example.) A GtkGraphics object is created
differently for realized and un-realized components. When we get a paint
event for an unrealized component and try to use the associated
GdkGraphics object bad things happen (because NSA_GET_G_PTR returns null
in such cases).

The attached hack makes things work for now by just ignoring such paint
events for such objects. It gives:

NOT handling 
java.awt.event.PaintEvent[UPDATE,updateRect=java.awt.Rectangle[x=0,y=0,width=360,height=300]]
 on org.hsqldb.util.Grid[panel0,0,0,360x300,invalid,parent=panel1] for 
UNREALIZED org.hsqldb.util.Grid[panel0,0,0,360x300,invalid,parent=panel1]

I like to debug this a bit further, but I couldn't find good
documentation on the handling of (un)realized GtkComponentPeers. Does
anybody have a link or an explanation of whether or not the above should
ever happen?

Thanks,

Mark

diff -u -r1.100 GtkComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkComponentPeer.java 8 Feb 2006 14:35:10 -  
1.100
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java 9 Feb 2006 12:43:59 -
@@ -306,6 +306,13 @@
   {
 try
   {
+   if (! isRealized())
+ {
+   System.err.println(NOT handling  + event
+  +  for UNREALIZED  + awtComponent);
+   break;
+ }
+
 Graphics g = getGraphics();

 if (awtComponent.getWidth()  1 || awtComponent.getHeight()  1)




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


Re: GtkComponentPeer realization

2006-02-09 Thread Thomas Fitzsimmons
On Thu, 2006-02-09 at 13:52 +0100, Mark Wielaard wrote:
 Hi,
 
 After a lot of debugging I finally found out why a program I was testing
 was crashing sometimes. (The hsqldb AWT frontend - try the
 org.hsqldb.util.DatabaseManager class from the hsqldb.jar as distributed
 with OpenOffice for example.) A GtkGraphics object is created
 differently for realized and un-realized components. When we get a paint
 event for an unrealized component and try to use the associated
 GdkGraphics object bad things happen (because NSA_GET_G_PTR returns null
 in such cases).
 
 The attached hack makes things work for now by just ignoring such paint
 events for such objects. It gives:
 
 NOT handling 
 java.awt.event.PaintEvent[UPDATE,updateRect=java.awt.Rectangle[x=0,y=0,width=360,height=300]]
  on org.hsqldb.util.Grid[panel0,0,0,360x300,invalid,parent=panel1] for 
 UNREALIZED org.hsqldb.util.Grid[panel0,0,0,360x300,invalid,parent=panel1]
 
 I like to debug this a bit further, but I couldn't find good
 documentation on the handling of (un)realized GtkComponentPeers. Does
 anybody have a link or an explanation of whether or not the above should
 ever happen?

Yes it can happen especially in multi-threaded applications.  You're
probably right to just ignore the paint event.  It'd be useful to know
if hsqldb makes calls into the peers from different threads.  For
example if it shows a window in one thread and another thread handles
painting on that window.

An unrealized GtkComponentPeer is a GtkWidget that has an uninitialized
X window field.  In other words, the X server doesn't have a window data
structure allocated for it.  We used to force-realize every
GtkComponentPeer on construction but that lead to strange behaviour when
adding a hierarchy of components to an already-shown container (all
components would be shown first at 0,0-1x1 then layed out after that).
Delayed realization makes the peer code much more complicated, and
adding a container to an already-shown container is rare so I'm thinking
it may be acceptable to switch the code back to
force-realization-on-creation.  It would simplify GtkComponentPeer
GdkGraphics and would probably eliminate these situations that you're
describing.

Tom





Re: Classpath on Cgwin: UnsatisfiedLinkError problem

2006-02-09 Thread Enrico Migliore

Archie Cobbs wrote:


S. Meslin-Weber wrote:


VM writers typically handle the delegated loadLibrary() call via their
implementation of the VM* interface classes and in their own native
code.

As cygwin uses a decidedly odd naming convention for its dlls, I'd say
those parts of jc would need to be investigated. IIRC, Cygwin calles its
equivalent of libjavanio.so cygjavanio-0.dll.



So... what's an #ifdef one can use on cygwin to detect cygwin?
E.g. #ifdef WINDOWS or #ifdef CYGWIN or something? (This is hard
for me to fix right now because I don't have cygwin set up anywhere).

Presumably other VMs have the same issue (if they want to run
on cygwin). Has anyone already solved this problem?

Enrico: the relevant macro is _JC_LIBRARY_FMT in definitions.h.
Perhaps you can play with some possibilities there.

Thanks,
-Archie


Hi Archie and Steph,

I found _JC_LIBRARY_FMT in arch_definitions.h and replaced .so with .dll.a,
which is the file extension of the dll libary created by Classpath.

Now I got an annoying problem on my WindowsXP Home Edition:

jc can't execute the libjavanio.dll.a library because permission is 
denied.


I tried to change the file access permission, from:

  -rwxr--r-- /usr/local/classpath/lib/classpath/libjavanio.dll.a
to
  -rwxr-xr-x /usr/local/classpath/lib/classpath/libjavanio.dll.a

but Cygwin doesn't let me do it because, I think, the user Enrico is not 
the

Administrator. Then I tried to add a new user named Administrator but
Windows XP Home Edition doesn't let me do it because Administrator 
exists already



I think I have to retry on a Windows Professional Edition.

I'll do this job during the weekend.

ciao,
Enrico






Re: Usage of System.getProperty() vs. SystemProperties.getProperty()

2006-02-09 Thread Tom Tromey
 Gary == Gary Benson [EMAIL PROTECTED] writes:

 The reason there is still a lot of code that uses System.getProperty()
 is either historical (i.e. SystemProperties was introduced after
 that code was written) or because the author was unaware of
 SystemProperties.  We've not been as careful about this as we maybe
 should be.

Gary The Mauve tests I am writing should cover every method that's
Gary documented as performing security tests on a property, so don't
Gary worry about accidentally writing something insecure: I ought to
Gary catch it in the next few weeks.

I think the issue here is what happens when some random piece of
Classpath is run in an environment with a security manager.  In this
case, the theory goes, we could get security failures where they ought
not occur.  So, we end up using SystemProperties and PrivilegedAction
all over the place...

IOW the security tests are testing that we properly call the security
manager in every place we're required to.  This is great and
definitely necessary.  But, it won't catch this failure mode, which is
that we're calling the security manager, and being rejected, when that
ought not to happen.

Honestly I still wonder whether this is really correct -- it just
seems too heavy.  But I have not investigated it in a real way, so I'm
just spouting off here.

Tom



Re: Usage of System.getProperty() vs. SystemProperties.getProperty()

2006-02-09 Thread David Daney

Tom Tromey wrote:

Gary == Gary Benson [EMAIL PROTECTED] writes:




The reason there is still a lot of code that uses System.getProperty()
is either historical (i.e. SystemProperties was introduced after
that code was written) or because the author was unaware of
SystemProperties.  We've not been as careful about this as we maybe
should be.



Gary The Mauve tests I am writing should cover every method that's
Gary documented as performing security tests on a property, so don't
Gary worry about accidentally writing something insecure: I ought to
Gary catch it in the next few weeks.

I think the issue here is what happens when some random piece of
Classpath is run in an environment with a security manager.  In this
case, the theory goes, we could get security failures where they ought
not occur.  So, we end up using SystemProperties and PrivilegedAction
all over the place...

IOW the security tests are testing that we properly call the security
manager in every place we're required to.  This is great and
definitely necessary.  But, it won't catch this failure mode, which is
that we're calling the security manager, and being rejected, when that
ought not to happen.



So what should happen in a class like 
gnu/java/net/protocol/http/HTTPConnection when we have to read properties?


Should it use SystemProperties or PrivilegedAction?  And is the answer 
documented anywhere?


David Daney.



Re: Usage of System.getProperty() vs. SystemProperties.getProperty()

2006-02-09 Thread Tom Tromey
 David == David Daney [EMAIL PROTECTED] writes:

David So what should happen in a class like
David gnu/java/net/protocol/http/HTTPConnection when we have to read
David properties?

David Should it use SystemProperties or PrivilegedAction?

SystemProperties.

David And is the answer documented anywhere?

Not that I know of.

Tom



Re: GtkComponentPeer realization

2006-02-09 Thread Mark Wielaard
Hi Tom,

On Thu, 2006-02-09 at 09:53 -0500, Thomas Fitzsimmons wrote:
 On Thu, 2006-02-09 at 13:52 +0100, Mark Wielaard wrote:
  I like to debug this a bit further, but I couldn't find good
  documentation on the handling of (un)realized GtkComponentPeers. Does
  anybody have a link or an explanation of whether or not the above should
  ever happen?
 
 Yes it can happen especially in multi-threaded applications.  You're
 probably right to just ignore the paint event.  It'd be useful to know
 if hsqldb makes calls into the peers from different threads.  For
 example if it shows a window in one thread and another thread handles
 painting on that window.

No it doesn't. I was finally able to extract a simple testcase that
shows the problem which also doesn't use any extra application Threads.
See attached. If you update the tree to include Lillian's latest patches
for GtkPanelPeer (which made the logic more clear to me, thanks Lillian)
and add the following hack, you can see that the Panel doesn't seem to
get realized. And always will print out the following after clicking on
the button:

getGraphics() called on unrealized:
java.awt.Panel[panel0,4,25,66x25,invalid,parent=frame0,layout=java.awt.FlowLayout]

I am not sure how/where the GtkPanelPeer should have been realized
and/or whether this comes from the delayed realization you talked
about (I don't actually see where this Panel will ever get realized to
be honest).

The Hack (or workaround, if you only put in the return null, and not the
dumpStack):

--- gnu/java/awt/peer/gtk/GtkComponentPeer.java 9 Feb 2006 17:44:30 -   
1.101
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java 9 Feb 2006 23:14:19 -
@@ -263,6 +262,13 @@
 
   public Graphics getGraphics ()
   {
+if (! isRealized())
+  {
+   System.err.println(getGraphics() called on unrealized:  + awtWidget);
+   Thread.dumpStack();
+   return null;
+  }
+
 if (GtkToolkit.useGraphics2D ())
 return new GdkGraphics2D (this);
 else

Any insights on how to properly debug this welcome.

I do have one patch to make the event passing a bit simpler. That
doesn't change the result of this test case, but it makes it a little
easier to follow the events that are fired. I'll post it in a second to
the patches list.

Cheers,

Mark
import java.awt.*;
import java.awt.event.*;

public class PanelPanel extends Frame implements ActionListener
{
  public static void main(String[] args)
  {
new PanelPanel();
  }

  PanelPanel()
  {
Button b = new Button(Click me!);
b.addActionListener(this);
add(b);
pack();
show();
  }

  public void actionPerformed(ActionEvent ae)
  {
Panel p = new Panel();
p.setBounds(new Rectangle(20, 20));
removeAll();
add(p);
doLayout();
p.repaint();
  }
}


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


Re: Crypto/Security component in Bugzilla

2006-02-09 Thread Tom Tromey
 Mark == Mark Wielaard [EMAIL PROTECTED] writes:

Mark In that case it seems we don't need a keyword or meta-bug but just a new
Mark 'security' component covering java.security.* (Permissions, Policies,
Mark SecurityManager)?

As I recall the discussion was about security as cross-cutting
concern -- not exactly (or just) java.security but also security
issues anywhere in the library.

Tom



Re: Qt-Peer thread design broken

2006-02-09 Thread Tom Tromey
 Holger == Holger Schurig [EMAIL PROTECTED] writes:

Holger I've create a VERY simply AWT app (in fact I copied it from
Holger somewhere, as I'm not really a Java coder)
[ Qt/AWT questions and patches and stuff ]

I didn't see a reply to this on the list.
Did anybody every reply to you?

I'm not a Qt or AWT expert... but personally I think if you are
interested we should start you on the paperwork process and get you
checking in fixes.

Holger And that statement leads me to the assumption that the current
Holger design of qt-peer is fundamentally broken. It calls GUI
Holger classes from other threads, which is a No-No.

I think the Gtk peers had a similar issue.  I don't recall the
solution, but it should be in the code.

Tom



[commit-cp] classpath gnu/java/net/protocol/http/HTTPURLCon...

2006-02-09 Thread Wolfgang Baer
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Wolfgang Baer [EMAIL PROTECTED]   06/02/09 09:37:08

Modified files:
gnu/java/net/protocol/http: HTTPURLConnection.java 
.  : ChangeLog 
java/net   : URLConnection.java 

Log message:
2006-02-09  Wolfgang Baer  [EMAIL PROTECTED]

* java/net/URLConnection.java:
(setAllowUserInteraction): Throw IllegalStateException if connected.
(getRequestProperty): Document return value if key is null.
* gnu/java/net/protocol/http/HTTPURLConnection.java:
(getRequestProperty): Return null if key is null.
(getRequestProperties): Throw IllegalStateException if connected.
(setRequestProperty): Call super method for exception tests.
(addRequestProperty): Likewise.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java.diff?tr1=1.17tr2=1.18r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6311tr2=1.6312r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/java/net/URLConnection.java.diff?tr1=1.35tr2=1.36r1=textr2=text




[commit-cp] classpath gnu/java/security/jce/sig/EncodedKeyF...

2006-02-09 Thread Raif S. Naffah
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Raif S. Naffah [EMAIL PROTECTED]  06/02/09 11:52:49

Modified files:
gnu/java/security/jce/sig: EncodedKeyFactory.java 
   RSAKeyPairGeneratorSpi.java 
gnu/java/security/key/rsa: GnuRSAPrivateKey.java 
   RSAKeyPairGenerator.java 
   GnuRSAKey.java GnuRSAPublicKey.java 
.  : ChangeLog 
gnu/java/security/key/dss: DSSKeyPairPKCS8Codec.java 
Added files:
gnu/java/security/key/rsa: RSAKeyPairPKCS8Codec.java 
   RSAKeyPairX509Codec.java 

Log message:
2006-02-09  Raif S. Naffah  [EMAIL PROTECTED]

* gnu/java/security/key/rsa/RSAKeyPairX509Codec.java: New file.
* gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java: Likewise.
* gnu/java/security/key/rsa/RSAKeyPairGenerator.java
(PREFERRED_ENCODING_FORMAT): New constant.
(DEFAULT_ENCODING_FORMAT): Likewise.
(preferredFormat): New field.
(setup): Add support for preferred encoding format.
(generate): Call key constructors with explicit format identifier.
* gnu/java/security/key/rsa/GnuRSAPublicKey.java (GnuRSAPublicKey(2)):
Call constructor with 3 arguments..
(GnuRSAPublicKey(3)): New constructor.
(valueOf): Added support for ASN.1 format.
(getEncoded): Likewise.
* gnu/java/security/key/rsa/GnuRSAPrivateKey.java (GnuRSAPrivateKey(4)):
Call constructor with 5 arguments.
(GnuRSAPrivateKey(5)): New constructor.
(GnuRSAPrivateKey(9)): New constructor.
(valueOf): Added support for ASN.1 format.
(getEncoded): Likewise.
* gnu/java/security/key/rsa/GnuRSAKey.java (defaultFormat): New field.
(GnuRSAKey): Modified constructor.
(getFormat): Return preferred format identifier.
* gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java
(decodePrivateKey): Fixed documentation.
Check Version field.
* gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java
(initialize(int,SecureRandom)): Set ASN.1 as the preferred encoding
format.
(initialize(AlgorithmParameterSpec,SecureRandom)): Likewise.
* gnu/java/security/jce/sig/EncodedKeyFactory.java
(engineGeneratePublic): Added support for RSA.
(engineGeneratePrivate): Likewise.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java.diff?tr1=1.1tr2=1.2r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java.diff?tr1=1.1tr2=1.2r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/rsa/GnuRSAPrivateKey.java.diff?tr1=1.1tr2=1.2r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/rsa/RSAKeyPairGenerator.java.diff?tr1=1.2tr2=1.3r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/rsa/GnuRSAKey.java.diff?tr1=1.1tr2=1.2r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/rsa/GnuRSAPublicKey.java.diff?tr1=1.1tr2=1.2r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6312tr2=1.6313r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java.diff?tr1=1.1tr2=1.2r1=textr2=text




[commit-cp] classpath ./ChangeLog gnu/regexp/RE.java gnu/re...

2006-02-09 Thread Ito Kazumitsu
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Ito Kazumitsu [EMAIL PROTECTED]   06/02/09 13:44:59

Modified files:
.  : ChangeLog 
gnu/regexp : RE.java REMatch.java 
java/util/regex: Matcher.java 

Log message:
2006-02-09  Ito Kazumitsu  [EMAIL PROTECTED]

Fixes bug #26112
* gnu/regexp/RE.java(REG_REPLACE_USE_BACKSLASHESCAPE): New execution
flag which enables backslash escape in a replacement.
(getReplacement): New public static method.
(substituteImpl),(substituteAllImpl): Use getReplacement.
* gnu/regexp/REMatch.java(substituteInto): Replace $n even if n=10.
* java/util/regex/Matcher.java(appendReplacement)
Use RE#getReplacement.
(replaceFirst),(replaceAll): Use RE.REG_REPLACE_USE_BACKSLASHESCAPE.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6313tr2=1.6314r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/regexp/RE.java.diff?tr1=1.16tr2=1.17r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/regexp/REMatch.java.diff?tr1=1.6tr2=1.7r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/java/util/regex/Matcher.java.diff?tr1=1.12tr2=1.13r1=textr2=text




[commit-cp] classpath ./ChangeLog gnu/java/awt/peer/gtk/Gtk...

2006-02-09 Thread Lillian Angel
CVSROOT:/sources/classpath
Module name:classpath
Branch: 
Changes by: Lillian Angel [EMAIL PROTECTED]   06/02/09 15:41:35

Modified files:
.  : ChangeLog 
gnu/java/awt/peer/gtk: GtkPanelPeer.java GtkWindowPeer.java 

Log message:
2006-02-09  Lillian Angel  [EMAIL PROTECTED]

* gnu/java/awt/peer/gtk/GtkPanelPeer.java
(handleEvent): Added code to handle PaintEvent.UPDATE.
Sun does not call update(Graphics g) on Panels.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(handleEvent): New method. Added code to handle PaintEvent.UPDATE.
Sun does not call update(Graphics g) on Panels.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6316tr2=1.6317r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/awt/peer/gtk/GtkPanelPeer.java.diff?tr1=1.19tr2=1.20r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java.diff?tr1=1.42tr2=1.43r1=textr2=text




[commit-cp] classpath javax/swing/plaf/basic/BasicTextUI.ja...

2006-02-09 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Roman Kennke [EMAIL PROTECTED]06/02/09 13:56:29

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

Log message:
2006-02-09  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/plaf/basic/BasicTextUI.java
(RootView.paint): Call setSize() before painting the view.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java.diff?tr1=1.66tr2=1.67r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6314tr2=1.6315r1=textr2=text




[commit-cp] classpath ./ChangeLog native/jni/gtk-peer/gnu_j...

2006-02-09 Thread Mark Wielaard
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Mark Wielaard [EMAIL PROTECTED]   06/02/09 16:00:49

Modified files:
.  : ChangeLog 
native/jni/gtk-peer: gnu_java_awt_peer_gtk_GtkScrollbarPeer.c 

Log message:
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Make sure max is
creater than min, adjusting page_size if necessary.
(Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues): Likewise.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6317tr2=1.6318r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollbarPeer.c.diff?tr1=1.2tr2=1.3r1=textr2=text




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

2006-02-09 Thread Roman Kennke
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Roman Kennke [EMAIL PROTECTED]06/02/09 17:15:33

Modified files:
javax/swing/text: DefaultCaret.java 

Log message:
2006-02-09  Roman Kennke  [EMAIL PROTECTED]

* javax/swing/text/DefaultCaret.java
(DocumentHandler.removeUpdate): When update policy is
'on eventqueue', and the update doesn't come from the
event queue, check if the current dot location is still
valid.
(moveDot): Make sure the new dot location is valid.
(setDot): Set the mark the same as the dot.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/javax/swing/text/DefaultCaret.java.diff?tr1=1.29tr2=1.30r1=textr2=text




[commit-cp] classpath gnu/java/net/protocol/http/HTTPURLCon...

2006-02-09 Thread Wolfgang Baer
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Wolfgang Baer [EMAIL PROTECTED]   06/02/09 20:54:56

Modified files:
gnu/java/net/protocol/http: HTTPURLConnection.java Response.java 
.  : ChangeLog 

Log message:
2006-02-09  Wolfgang Baer  [EMAIL PROTECTED]

* gnu/java/net/protocol/http/HTTPURLConnection.java:
(isRedirect): Removed, moved to Response.java.
(connect): If error condition redirect responseSink to errorSink.
(getInputStream): If error condition throw IOException, for the error
codes 404 and 410 throw a FileNotFoundException.
* gnu/java/net/protocol/http/Response.java (isError): New method.
(isRedirect): New method, moved from HTTPURLConnection.java.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java.diff?tr1=1.18tr2=1.19r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/gnu/java/net/protocol/http/Response.java.diff?tr1=1.3tr2=1.4r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6322tr2=1.6323r1=textr2=text




[commit-cp] classpath ./ChangeLog doc/unicode/SpecialCasing...

2006-02-09 Thread Anthony Balkissoon
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Anthony Balkissoon [EMAIL PROTECTED]  06/02/09 21:15:55

Modified files:
.  : ChangeLog 
Added files:
doc/unicode: SpecialCasing-4.0.0.txt UnicodeData-4.0.0.txt 

Log message:
2006-02-09  Anthony Balkissoon  [EMAIL PROTECTED]

* doc/unicode/SpecialCasing-4.0.0.txt: New file.
* doc/unicode/UnicodeData-4.0.0.txt: New file.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6323tr2=1.6324r1=textr2=text
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/doc/unicode/SpecialCasing-4.0.0.txt?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/doc/unicode/UnicodeData-4.0.0.txt?rev=1.1




[commit-cp] classpath ChangeLog

2006-02-09 Thread Wolfgang Baer
CVSROOT:/cvsroot/classpath
Module name:classpath
Branch: 
Changes by: Wolfgang Baer [EMAIL PROTECTED]   06/02/09 21:21:17

Modified files:
.  : ChangeLog 

Log message:
Fixed changelog to include PR number

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/classpath/ChangeLog.diff?tr1=1.6324tr2=1.6325r1=textr2=text