[cp-patches] FYI: Implementing multiple editors for JTable (with example)

2006-01-19 Thread Meskauskas Audrius
This patch add the multi-editor support for JTable. The table now 
supports the two editors: text and boolean. The boolean values are 
rendered and edited using JCheckBox.


I  add the more complicated table example to the Swing demo to show the 
table with header, multiple data types (text and boolean at the moment) 
and placed int the scroll window. The editing seems working as expected 
but the attempt to scroll transiently displays the old (unedited) 
values. As any forced repainting (resizing, temporary obstruction with 
other window) displays the updated values again, this may be the problem 
somewhere in the JScrollPane.


2006-01-19  Audrius Meskauskas  [EMAIL PROTECTED]

   * javax/swing/JTable.java (editingStopped, editingCancelled):
   Repaint the edited cell.
   (setValueAt): Do not add the value object to this container.
   (editorTimer, rowBeingEdited, columnBeingEdited, oldCellValue): Removed.
   (editingStopped): Use editingRow, editingColumn and not
   rowBeingEdited, columnBeingEdited. (editValueAt): rewritten.
   (doLayout): Move the editor component, if present, into the new
   location and call repaint(). (moveToCellBeingEdited): new method.
   (TableTextField): new inner class.
   (getDefaultEditor): Instantiante TableTextField, not JTextField.
   (setValueAt): Repaint the changed segment.
   (createDefaultEditors): Implemented.
   (BooleanCellRenderer): Center the checkbox and use the default 
foreground
   and background colors.   
   * javax/swing/plaf/basic/BasicTableUI.java
   (paintCell): Do not paint the caret here. Do not accept unused 
parameters.
   (paint): No need to allocate rectangle for each cell.   
   * javax/swing/DefaultCellEditor.java: Rewritten. 
   * examples/gnu/classpath/examples/swing/Demo.java (mkTable):

 Use TableDemo.java table example.
   * examples/gnu/classpath/examples/swing/TableDemo.java: New file.
Index: javax/swing/DefaultCellEditor.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultCellEditor.java,v
retrieving revision 1.17
diff -u -r1.17 DefaultCellEditor.java
--- javax/swing/DefaultCellEditor.java  16 Jan 2006 12:36:50 -  1.17
+++ javax/swing/DefaultCellEditor.java  19 Jan 2006 12:13:08 -
@@ -59,8 +59,7 @@
  * some standard object types.
  * 
  * @author Andrew Selkirk
- *
- * @status mostly unimplemented
+ * @author Audrius Meskauskas
  */
 public class DefaultCellEditor
   extends AbstractCellEditor
@@ -76,10 +75,13 @@
   protected class EditorDelegate
 implements ActionListener, ItemListener, Serializable
   {
+/**
+ * Use the serial version UID for interoperability.
+ */
 private static final long serialVersionUID = -1420007406015481933L;
 
 /**
- * value
+ * The object value (updated when getting and setting the value).
  */
 protected Object value;
 
@@ -90,28 +92,30 @@
 {
   // Nothing to do here.
 }
-
+
 /**
- * setValue
+ * Set the value for the editor component. This method is normally
+ * overridden to set the value in the way, specific for the text
+ * component, check box or combo box.
  *
- * @param value TODO
+ * @param aValue the value to set (String, Boolean or Number).
  */
-public void setValue(Object value)
+public void setValue(Object aValue)
 {
-  // TODO: should be setting the value in the editorComp
-  this.value = value;
+  value = aValue;
 }
 
-   /**
- * getCellEditorValue
- * 
- * @returns Object
+/**
+ * Get the value for the editor component. This method is normally
+ * overridden to obtain the value in the way, specific for the text
+ * component, check box or combo box.
+ *
+ * @return value the value of the component (String, Boolean or Number).
  */
 public Object getCellEditorValue()
 {
-  // TODO: should be getting the updated value from the editorComp
   return value;
-} // getCellEditorValue()
+} 
 
 /**
  * isCellEditable
@@ -208,16 +212,132 @@
 listeners[index].editingCanceled(changeEvent);
 }
   } // EditorDelegate
+  
+  /**
+   * Provides getter and setter methods to work with the text component.
+   * 
+   * @author Audrius Meskauskas ([EMAIL PROTECTED])
+   */
+  private class JTextFieldDelegate extends EditorDelegate
+  {
+/**
+ * Use the serial version UID for interoperability.
+ */
+private static final long serialVersionUID = 1;
+
+/**
+ * Set the value for the editor component.
+ *
+ * @param aValue the value to set (toString() will be called).
+ */
+public void setValue(Object aValue)
+{
+  value = aValue;
+  JTextField f = (JTextField) editorComponent;
+  if (value == null)
+f.setText();
+  else
+f.setText(value.toString());
+}
 
-   /**
+/**
+ * Get the value for the editor component. 

[cp-patches] FYI: Implementing cell editing in JTable.

2006-01-16 Thread Meskauskas Audrius
This patch implements the cell editing in JTable. The editing session 
can be started by double clicking on the cell and completed by pressing 
Enter or canceled by pressing ESC. The table is updated and stores the 
changed value. This can be tested in the table of the Swing demo.


The implementation for the user-defined text editors is till missing.

2006-01-16  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/DefaultCellEditor.java
(delegate): Assign new instance immediately.
(DefaultCellEditor(JTextField textfield)): Require 2 clicks.
(getTableCellEditorComponent): Rewritten.
(prepareAsJTextField):New method (add listener only once).
* javax/swing/JTable.java
(editingCanceled): Rewritten.
(editingStopped ): Rewritten.
(rowAtPoint): Mind row margin.
(getCellRect): Mind row margin.
(getDefaultEditor): Removing JTextComponent border.
(editCellAt): Rewritten.
javax/swing/plaf/basic/BasicTableUI.java (MouseInputHandler):
Activate editing mode by the mouse clicks.
(getMaximumSize): Mind row margin.
(getPreferredSize): Mind row margin.
(TableAction): Added 'stop editing' command.

Index: javax/swing/DefaultCellEditor.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/DefaultCellEditor.java,v
retrieving revision 1.16
diff -u -r1.16 DefaultCellEditor.java
--- javax/swing/DefaultCellEditor.java  19 Oct 2005 15:45:03 -  1.16
+++ javax/swing/DefaultCellEditor.java  15 Jan 2006 23:17:36 -
@@ -215,9 +215,9 @@
   protected JComponent editorComponent;
 
   /**
-   * delegate
+   * The editor delegate (normally intialised only once).
*/
-  protected EditorDelegate delegate;
+  protected EditorDelegate delegate = new EditorDelegate();
 
   /**
* clickCountToStart
@@ -232,7 +232,7 @@
   public DefaultCellEditor(JTextField textfield)
   {
 editorComponent = textfield;
-clickCountToStart = 3;
+clickCountToStart = 2;
   } // DefaultCellEditor()
 
   /**
@@ -386,13 +386,14 @@
   } // getTreeCellEditorComponent()
 
   /**
-   * getTableCellEditorComponent
+   * Get the cell editor component that will perform the editing session.
+   * If returned once, the same component should be returned again (reused).
* 
-   * @param table TODO
-   * @param value TODO
-   * @param isSelected TODO
-   * @param row TODO
-   * @param column TODO
+   * @param table the table where the editing is performed
+   * @param value the current value of the table
+   * @param isSelected if true, the cell is currently selected
+   * @param row the row of the cell being edited
+   * @param column the column of the cell being edited
*
* @returns Component
*/
@@ -402,24 +403,42 @@
   {
 // NOTE: as specified by Sun, we don't call new() everytime, we return 
 // editorComponent on each call to getTableCellEditorComponent or
-// getTreeCellEditorComponent.  However, currently JTextFields have a
-// problem with getting rid of old text, so without calling new() there
-// are some strange results.  If you edit more than one cell in the table
-// text from previously edited cells may unexpectedly show up in the 
-// cell you are currently editing.  This will be fixed automatically
-// when JTextField is fixed.
+// getTreeCellEditorComponent.  
 if (editorComponent instanceof JTextField)
-  {
-((JTextField)editorComponent).setText(value.toString());
-delegate = new EditorDelegate();
-((JTextField)editorComponent).addActionListener(delegate);
-  }
-else
-  {
-// TODO
-  }
+  prepareAsJTextField(value);
 return editorComponent;
   } // getTableCellEditorComponent()
+  
+  /**
+   * Prepare the editorComponent as the text field.
+   * 
+   * @param value the value of the cell before editin.
+   */
+  private void prepareAsJTextField(Object value)
+  {
+JTextField f = (JTextField) editorComponent;
+if (value != null)
+  f.setText(value.toString());
+else
+  // Default null to the empty string.
+  f.setText();
 
+// Do not register our listener again and again (resource leak).
+ActionListener[] l = f.getActionListeners();
+
+boolean have = false;
+for (int i = 0; i  l.length; i++)
+  {
+// We cannot just remove all listeners as the user listeners 
+// may be registered.
+if (l[i]==delegate)
+  {
+have = true;
+break;
+  }
+  }
+if (!have)
+  f.addActionListener(delegate);
+  }
 
 }
Index: javax/swing/JTable.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.64
diff -u -r1.64 JTable.java
--- javax/swing/JTable.java 17 Dec 2005 00:50:48 -  1.64
+++ javax/swing/JTable.java 15 Jan 2006 23:19:04 -
@@ -1765,44 +1765,39 @@
   {
 repaint();
   }
-
+  
   public void editingCanceled (ChangeEvent 

Re: Updating Mauve tags

2006-01-16 Thread Meskauskas Audrius
The Sun's swing did have as many as 6514 bugs through the history, 
despite many of them are fixed
now. Together with the new features and improvements, each new major 
release inevitably brings
some regressions that are later fixed. J2SE 5.0 
http://java.sun.com/j2se/1.5.0/download.jsp already had six updates in 
the past. They do make some
mistakes, same as we do, same as any java development group inevitably 
does. This may be especially
true for tests that were succeeding in the past but fail with the newest 
version.


Because of that reason I would not suggest any automated removal or 
inactivation of the tests just
because they fail on Sun's or any other java implementation. If the 
implemented behavior clearly
mismatches the Sun's API specification, this is probably just a bug that 
is likely to be fixed - probably in the

next minor release.

Some tests can be invalid and can be inactivated or removed (probably 
better altered, making them valid).
However I think that this work (a difficult work) must be done manually. 
The typical reason can be if we find
the similar problem in the Sun's bug reports and the Sun states that 
this is not a bug or it will never be fixed,
or if we realize that the former author of the test clearly 
misinterprets the Sun's API standard.


If needed, we could probably simply have and use the list of tests that 
are known to pass with the final
releases of the JDK 1.2, 1.3 and 1.4 (for the 1.5, such list would need 
the regular updates).


Audrius.

Roman Kennke wrote:


Hi Mark,

 


I see that we have a concept of tags in Mauve. That is a collection of
keys at the top of each test class. This way we can filter the tests.
ATM we have tags for the JDK versions like JDK1.4 JDK1.3 and so on and a
couple of other tags. However, it seems that they are not maintained in
a usable way, so most people simply include every tag that they can
think of (that is what's done in batch_run for example) to run all
tests.
 


Why do you feel they aren't maintained in a usable way?
   



This was caused by a misunderstanding of the usage/meaning of those
tags. I was thinking that when a test has the tag JDK1.x, that this test
is meant to PASS under a JDK1.x-ish JDK. As Michael and others have
pointed out on IRC this is not the case. If I want to test a JDK1.3-sh
(for example) environment I should include JDK1.0 JDK1.1 JDK1.2 and
JDK1.3 tags in my keys.

The problem that I am seeing is when a test that is written to PASS
under 1.4 fails under 1.5. There are lots of those tests in the
testsuite for the javax.swing package. So my plan would have been to tag
all tests that pass under JDK1.5 with the 1.5 tag and those that don't
only with JDK1.4 or whatever is ok. Since the tags are not meant to be
used that way, maybe we can do it different. Could we extend the
choose-classes script to detect !JDK1.x tags in the tag header of java
source files and don't include the test in a JDK1.x test run?

/Roman
 





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


Re: a crazy idea -- the Book

2006-01-16 Thread Meskauskas Audrius
Typically, the best books are written by the authors of the methods or 
other things that are present in the book. For instance, the Molecular 
Cloning: A Laboratory Manual is present in near every serious 
biochemical laboratory, despite this book costs several hundreds of 
dollars. The book is popular because it consists of multiple chapters, 
written separately mainly by the authors of the described methods. It is 
more popular than many other books, describing the same methods and 
costing one order of magnitude less.


If this is true for java also, the really good books can be written 
either by Sun,  by active members of our project and probably by the 
authors of other Sun API implementations. For parts where the 
development is no longer active the sections could also be written by 
somebody else of (if there are enough material) maybe even skipped.


Between the proposed topics of the book it could be (the list is 
discussible):
1. Advanced use of the standard java API. For simplicity, we can just 
assume that the reader knows the java language and various simple things 
like how to display a JFrame or iterate over collection. I suggest to 
assume that the reader is somebody like Sun Certified Java Programmer 
(then the program of that exam can be used to check what the reader 
already knows).  We can focus mainly on packages and classes where the 
topics are difficult and  documentation is very incomplete or even 
missing: advanced networking, swing models, non trivial class loaders 
and so on.


There are already many - too many - books for beginners, frequently 
describing details that can be learned from the web without any book at all.
2. Each free java virtual machine project can contribute a chapter about 
that virtual machine. These must be the informative, useful chapters, 
giving the potentially useful technical details - not just the lists of 
supported platforms.
3. The structure of the GNU Classpath project can be described - that 
autogen.sh does, that configure.sh does, how this library is connected 
to the java virtual machine and so on.


Other ideas can also be suggested.

Hence we can write such book if there are enough persons willing to 
contribute chapters about the Free Java parts that they have 
implemented. In the past, I wrote multiple scientific articles for 
various journals (in English), once needed to write, technically prepare 
and arrange printing (but not distribution) of the small book and twice 
was supervising the shared development of the multi-author book where 
each author was contributing a separate chapter. If required, I can take 
the co-ordination of this Classpath subproject.


In the first step, we need the chapter proposals (topic and possible 
date of submission). Using  the CVS history information it is easy to 
set the priorities if several potential contributors want to write 
chapter about the same (or they can be just told to co-operate).


In the second stage, the book is composed from the received chapters. 
Normally the authors then receive they sections as they would appear in 
the book for the additional editing and proofs.


Finally the printing and distribution must be arranged. People probably 
may be more motivated and write more material if at least part of the 
profit from that book would be returned back to the authors. If I am 
wrong with this way thinking here, the better. Surely there are other 
reasons to contribute.


Audrius.




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


[cp-patches] FYI: Render null as the empty cell in JTable

2006-01-15 Thread Meskauskas Audrius
If the JTable model returns null, our recent implementation does not set 
the value at all. The visible content
of such cell replicates the value of the adjacent cell. Sun's 
implementation renders the null value as the
empty cell. With one user application I have observed the strange 
content replication for the cells that should
be displayed as empty. This path sets the empty string value for the 
renderer is such case, making our

behavior identical with Sun's.

2006-01-15  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/table/DefaultTableCellRenderer.java 
(getTableCellRendererComponent):

Render null as the empty cell.
Index: javax/swing/table/DefaultTableCellRenderer.java
===
RCS file: 
/cvsroot/classpath/classpath/javax/swing/table/DefaultTableCellRenderer.java,v
retrieving revision 1.23
diff -u -r1.23 DefaultTableCellRenderer.java
--- javax/swing/table/DefaultTableCellRenderer.java 24 Nov 2005 20:26:35 
-  1.23
+++ javax/swing/table/DefaultTableCellRenderer.java 15 Jan 2006 17:24:08 
-
@@ -127,7 +127,8 @@
* Get the string value of the object and pass it to setText().
*
* @param table the JTable
-   * @param value the value of the object
+   * @param value the value of the object. For the text content,
+   *null is rendered as an empty cell.
* @param isSelected is the cell selected?
* @param hasFocus has the cell the focus?
* @param row the row to render
@@ -146,6 +147,9 @@
   return new JTextField(((JTextField)value).getText());
 super.setText(value.toString());
   }
+else
+  // null is rendered as an empty cell.
+  super.setText();
 
 setOpaque(true);
 
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: a crazy idea -- the Book

2006-01-15 Thread Meskauskas Audrius
Great idea, I think! If this idea would move ahead, I am ready to join 
by writing sections about the javax.swing.text.html.parser,  javax.rmi 
and org.omg. package groups.  We maybe can divide chapters.  I think, it 
would be good to have the printed book and not the web site content.


Printing the book would probably require the initial money investment. 
This probably can be solved at least in the two ways:
1. The FSF pays for printing of this book and then gets the profit from 
selling it.
2. All authors contribute for printing of this book and then probably 
share the profit. With the large number of authors, both money 
contribution and expected profit will probably not be very big anyway.


Scientists and writers print books rather frequently, and also quite 
often completely on they own initiative. Probably some infrastructure 
should exist that would make the task not especially complicated, we may 
just need to find these people, probably in several countries, comparing 
prices and possibilities.


Audrius.

Raif S. Naffah wrote:


hello all,

with every visit to the bookstore i see new titles about java, swing, 
etc.  most of them being just printed collections of already public 
APIs.


Classpath is more than just a bunch of APIs, and if there's a book worth 
reading about Java (and free VMs) it would be about what this project, 
its team of collaborators and hackers, and user VMs.  i'm not talking 
about people but software: what more, or better, Classpath + friends 
offer to the Java developers.


has anybody given a thought to the idea of publishing such a book?


cheers;
rsn
 




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





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


[cp-patches] FYI:Throwing different exception in gnu/java/rmi/server/UnicastRef.java

2006-01-12 Thread Meskauskas Audrius
The Sun's implementation throws java.rmi.ConnectException (subclass of 
RemoteException) in the case of failure to establish the connection. Our 
implementation throws the  RemoteException itself. This crashes 
applications that specifically catch ConnectException. In Classpath, 
this exception is thrown from gnu/java/rmi/server/UnicastRef.java 
(newCall).


2006-01-13  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/java/rmi/server/UnicastRef.java (newCall):
   Throw ConnectException after catching IOException.
Index: gnu/java/rmi/server/UnicastRef.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/rmi/server/UnicastRef.java,v
retrieving revision 1.8
diff -u -r1.8 UnicastRef.java
--- gnu/java/rmi/server/UnicastRef.java 2 Jul 2005 20:32:14 -   1.8
+++ gnu/java/rmi/server/UnicastRef.java 13 Jan 2006 04:12:32 -
@@ -47,6 +47,7 @@
 import java.io.ObjectOutputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.rmi.ConnectException;
 import java.rmi.Remote;
 import java.rmi.RemoteException;
 import java.rmi.server.ObjID;
@@ -195,7 +196,7 @@
conn = manager.getConnection();
}
catch (IOException e1) {
-   throw new RemoteException(connection failed to host:  + 
manager.serverName, e1);
+   throw new ConnectException(connection failed to host:  + 
manager.serverName, e1);
}
 
 //obj: useless?
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: First class for javax.management.

2006-01-10 Thread Meskauskas Audrius
There are very many various classes, methods and fields with names, 
containing  underscores in the official org.omg namespace (see 
org.omg.PortableInterceptor.IORInterceptor_3_0Operations for instance). 
Hence we must use them anyway. I am not sure if the underscores are 
really bad for separating prefix from the main name component.


Audrius

Chris Burdess wrote:


Meskauskas Audrius wrote:
 


 /**
  * The attribute name.
  */
 final String m_name;

 /**
  * The attribute value.
  */
 final Object m_value;
   



Do we really need all this m_* Hungarian notation business? We don't use
this form (or indeed underscores at all) anywhere else in Classpath. 
 





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


[cp-patches] FYI: First class for javax.management.

2006-01-09 Thread Meskauskas Audrius

2006-01-09  Audrius Meskauskas  [EMAIL PROTECTED]

* javax.management.Attribute.java: New file.

/* Attribute.java --
   Copyright (C) 2006 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
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.management;

import java.io.Serializable;

/**
 * Represents an MBean attribute, having the name and the assined value. The
 * MBean objects use this class to get and set attributes values.
 * 
 * @since 1.5
 * 
 * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
 */
public class Attribute
  implements Serializable
{
  /**
   * The attribute name.
   */
  final String m_name;

  /**
   * The attribute value.
   */
  final Object m_value;

  /**
   * Create the attribute with the given name and value.
   * 
   * @param name the attribute name
   * @param value the attribute value
   */
  public Attribute(String name, Object value)
  {
m_name = name;
m_value = value;
  }

  /**
   * Compares the attribute with another attribute.
   * 
   * @param other the other object to compare with
   * 
   * @return true if both value and object are equal, false otherwise.
   */
  public boolean equals(Object other)
  {
if (other instanceof Attribute)
  {
Attribute oa = (Attribute) other;
boolean n, v;
if (oa.m_name == null || m_name == null)
  n = oa.m_name == m_name;
else
  n = oa.m_name.equals(m_name);

if (oa.m_value == null || m_value == null)
  v = oa.m_value == m_value;
else
  v = oa.m_value.equals(m_value);

return n  v;

  }
else
  return false;
  }

  /**
   * Returns the attribute name.
   * 
   * @return the attribute name
   */
  public String getName()
  {
return m_name;
  }

  /**
   * Returns the attribute value.
   * 
   * @return the attribute value.
   */
  public Object getValue()
  {
return m_value;
  }

  /**
   * Need to override as [EMAIL PROTECTED] #equals} is overridden.
   * 
   * @return the expression, dependent of the object and name hashcodes.
   */
  public int hashCode()
  {
int n = m_name==null?0:m_name.hashCode();
int v = m_value==null?0:m_value.hashCode();

return n ^ v;
  }

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


[cp-patches] FYI:Removing non ASCII character from org/omg/CORBA/INVALID_ACTIVITY.java

2006-01-07 Thread Meskauskas Audrius

2006-01-07  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/CORBA/INVALID_ACTIVITY.java: Removed non - ASCII character 
(line 46).


Index: org/omg/CORBA/INVALID_ACTIVITY.java
===
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/INVALID_ACTIVITY.java,v
retrieving revision 1.1
diff -u -r1.1 INVALID_ACTIVITY.java
--- org/omg/CORBA/INVALID_ACTIVITY.java 22 Oct 2005 19:57:03 -  1.1
+++ org/omg/CORBA/INVALID_ACTIVITY.java 7 Jan 2006 18:44:48 -
@@ -43,7 +43,7 @@
 /**
  * Raised when the transaction or Activity is resumed in a different context
  * than from which it was suspended. It is also raised when the invocation is
- * not incompatible with the Activity’s current state.
+ * not incompatible with the Activity's current state.
  *
  * @since 1.5
  *
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: New GNU Classpath developer Raif Naffah

2006-01-03 Thread Meskauskas Audrius

Congratulations, Raif, nice to meet  you!

Audrius



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


[cp-patches] FYI: More comprehensive exception in gnu.CORBA

2005-12-31 Thread Meskauskas Audrius

2005-12-31  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/Poa/gnuPOA.java (reference_to_servant): Throw WrongAdapter with
explaining message.


Index: gnu/CORBA/Poa/gnuPOA.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Poa/gnuPOA.java,v
retrieving revision 1.5
diff -u -r1.5 gnuPOA.java
--- gnu/CORBA/Poa/gnuPOA.java   11 Nov 2005 11:39:34 -  1.5
+++ gnu/CORBA/Poa/gnuPOA.java   31 Dec 2005 17:43:40 -
@@ -1052,12 +1052,12 @@
 
   /**
* Returns the servant that is serving this object.
-   *
-   * @return if the RETAIN policy applies and the object is in the Active
-   * Object Map, the method returns the servant, associated with this object.
+   * 
+   * @return if the RETAIN policy applies and the object is in the Active 
Object
+   * Map, the method returns the servant, associated with this object.
* Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns
* the default servant (if one was set).
-   *
+   * 
* @throws ObjectNotActive if none of the conditions above are satisfied.
* @throws WrongAdapter if the object reference was not created with this 
POA.
* @throws WrongPolicy. This method requires either RETAIN or
@@ -1065,14 +1065,26 @@
* apply to this POA.
*/
   public Servant reference_to_servant(org.omg.CORBA.Object the_Object)
-   throws ObjectNotActive, WrongPolicy,
-  WrongAdapter
+throws ObjectNotActive, WrongPolicy, WrongAdapter
   {
 if (applies(ServantRetentionPolicyValue.RETAIN))
   {
 AOM.Obj ref = aom.findObject(the_Object);
 if (ref == null)
-  throw new WrongAdapter();
+  {
+String object;
+if (the_Object == null)
+  object = null passed; 
+else if (the_Object instanceof gnuServantObject)
+  {
+gnuServantObject gs = (gnuServantObject) the_Object;
+object = Wrong owner POA  + gs.poa.the_name();
+  }
+else
+  object = Unknown  + the_Object.getClass().getName();
+
+throw new WrongAdapter(object +  for ' + the_name() + ');
+  }
 else if (ref.isDeactiveted() || ref.servant == null)
   {
 if (default_servant != null)
@@ -1092,32 +1104,30 @@
   }
 
   /**
-  * Returns the id of the object, served by the given servant
-  * (assuming that the servant serves only one object).
-  * The id is found in one of the following ways.
-  * ul
-  * liIf the POA has both the RETAIN and the UNIQUE_ID policy and
-  * the specified servant is active, the method return the Object Id associated
-  * with that servant.
-  * /lili
-  * If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and
-  * either the POA has the MULTIPLE_ID policy or the specified servant is
-  * inactive, the method activates the servant using a POA-generated Object Id
-  * and the Interface Id associated with the servant, and returns that
-  * Object Id.
-  * /li
-  * liIf the POA has the USE_DEFAULT_SERVANT policy, the servant specified
-  * is the default servant, and the method is being invoked in the context of
-  * executing a request on the default servant, the method returns the
-  * ObjectId associated with the current invocation.
-  * /li
-  * /ul
-  * @throws ServantNotActive in all cases, not listed in the list above.
-  * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or
-  * a combination of the RETAIN policy and either the UNIQUE_ID or
-  * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions
-  * are not satisfied.
-  */
+   * Returns the id of the object, served by the given servant (assuming that
+   * the servant serves only one object). The id is found in one of the
+   * following ways.
+   * ul
+   * liIf the POA has both the RETAIN and the UNIQUE_ID policy and the
+   * specified servant is active, the method return the Object Id associated
+   * with that servant. /li
+   * li If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and
+   * either the POA has the MULTIPLE_ID policy or the specified servant is
+   * inactive, the method activates the servant using a POA-generated Object Id
+   * and the Interface Id associated with the servant, and returns that Object
+   * Id. /li
+   * liIf the POA has the USE_DEFAULT_SERVANT policy, the servant specified
+   * is the default servant, and the method is being invoked in the context of
+   * executing a request on the default servant, the method returns the 
ObjectId
+   * associated with the current invocation. /li
+   * /ul
+   * 
+   * @throws ServantNotActive in all cases, not listed in the list above.
+   * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or a
+   * combination of the RETAIN policy and either the UNIQUE_ID or
+   * IMPLICIT_ACTIVATION policies and 

Re: [cp-patches] FYI: Disallow unsecure copy/paste exchange

2005-12-04 Thread Meskauskas Audrius

Maybe yes.  The recent insecure approach comes from the historcal past.

Mark Wielaard wrote:


Hi,

After the last discussion about TransferHandler and security issues it
seemed safer to me to just disallow any copy/paste between untrusted
code paths as was suggested earlier.

2005-12-04  Mark Wielaard  [EMAIL PROTECTED]

   * javax/swing/TransferHandler
   (TransferAction.actionPerformed): Beep and return when clipboard
   is null.
   (getClipboard): Return null when access denied.
   (clipboard): Removed static field.

Committed,

Mark
 




Index: javax/swing/TransferHandler.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/TransferHandler.java,v
retrieving revision 1.12
diff -u -r1.12 TransferHandler.java
--- javax/swing/TransferHandler.java22 Nov 2005 16:07:57 -  1.12
+++ javax/swing/TransferHandler.java4 Dec 2005 19:50:34 -
@@ -1,5 +1,5 @@
/* TransferHandler.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

@@ -43,6 +43,7 @@
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
+import java.awt.Toolkit;
import java.io.Serializable;

public class TransferHandler implements Serializable
@@ -62,6 +63,13 @@
  TransferHandler transferHandler = component.getTransferHandler();
  Clipboard clipboard = getClipboard(component);

+  if (clipboard == null)
+   {
+ // Access denied!
+ Toolkit.getDefaultToolkit().beep();
+ return;
+   }
+
  if (command.equals(COMMAND_COPY))
transferHandler.exportToClipboard(component, clipboard, COPY);
  else if (command.equals(COMMAND_CUT))
@@ -76,8 +84,8 @@
}
  
/**

- * Get the system cliboard. If not available, create and return the 
VM-local
- * clipboard.
+ * Get the system cliboard or null if the caller isn't allowed to
+ * access the system clipboard.
 * 
 * @param component a component, used to get the toolkit.

 * @return the clipboard
@@ -85,22 +93,13 @@
private static Clipboard getClipboard(JComponent component)
{
  try
-{
-  SecurityManager sm = System.getSecurityManager();
-  if (sm != null)
-sm.checkSystemClipboardAccess();
-
-  // We may access the system clipboard.
-  return component.getToolkit().getSystemClipboard();
-}
-  catch (Exception e)
-{
-  // We may not access system clipboard.
-  // Create VM-local clipboard if none exists yet.
-  if (clipboard == null)
-clipboard = new Clipboard(Clipboard);
-  return clipboard;
-}
+   {
+ return component.getToolkit().getSystemClipboard();
+   }
+  catch (SecurityException se)
+   {
+ return null;
+   }
}
  }
  
@@ -118,12 +117,6 @@

  private static Action copyAction = new TransferAction(COMMAND_COPY);
  private static Action cutAction = new TransferAction(COMMAND_CUT);
  private static Action pasteAction = new TransferAction(COMMAND_PASTE);
-  
-  /**

-   * Clipboard if system clipboard may not be used.
-   * Package-private to avoid an accessor method.
-   */
-  static Clipboard clipboard;
  
  private int sourceActions;

  private Icon visualRepresentation;
 




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





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


Re: Strange failure [Fwd: Mail delivery failed: returning message to sender]

2005-12-02 Thread Meskauskas Audrius

Hello, Mark,

XOR maybe also would be good enough, but the hashcode method is called 
very seldom for this class. It is not involved into the main 
functionality and is only needed in some very specific cases like 
verifying the client identity. Hence the execution speed may not matter 
very much; I have chosed Adler as more reliable.


Mark Wielaard wrote:


Hi Audrius,

Just tried to sent this message, but it bounced. Trying from my other
email address now. Any idea why this is happening?

Cheers,

Mark
 





Subject:
Mail delivery failed: returning message to sender
From:
Mail Delivery System [EMAIL PROTECTED]
Date:
Fri, 02 Dec 2005 15:10:20 +0100
To:
[EMAIL PROTECTED]

To:
[EMAIL PROTECTED]


This message was created automatically by mail delivery software (Exim).

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

 [EMAIL PROTECTED]
   SMTP error from remote mailer after RCPT TO:[EMAIL PROTECTED]:
   host mxbw.bluewin.ch [195.186.18.144]: 550 RCPT TO:[EMAIL PROTECTED] 
Relaying not allowed

-- This is a copy of the message, including all the headers. --

Return-path: [EMAIL PROTECTED]
Received: from elsschot.wildebeest.org ([192.168.1.26])
by gnu.wildebeest.org with esmtp (Exim 3.36 #1 (Debian))
id 1EiBbn-0008L9-00; Fri, 02 Dec 2005 15:09:55 +0100
Subject: Re: [cp-patches] FYI: Fixes in org.omg.CORBA.Object._is_equivalent.
From: Mark Wielaard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: _ PATCHES classpath-patches@gnu.org classpath-patches@gnu.org
In-Reply-To: [EMAIL PROTECTED]
References: [EMAIL PROTECTED]
Content-Type: multipart/signed; micalg=pgp-sha1; protocol=application/pgp-signature; 
boundary==-UM7aozFctzAkjF67KfYe
Date: Fri, 02 Dec 2005 15:11:18 +0100
Message-Id: [EMAIL PROTECTED]
Mime-Version: 1.0
X-Mailer: Evolution 2.2.3 



--=-UM7aozFctzAkjF67KfYe
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi Audrius,

Going through some older patches.

On Sun, 2005-11-06 at 14:24 +0100, Meskauskas Audrius wrote:
 


+  /**
+   * Get the hashcode of this IOR.
+   */
+  public int hashCode()
+  {
+Adler32 adler =3D new Adler32();
+if (key !=3D null)
+  adler.update(key);
+if (Internet !=3D null  Internet.host !=3D null)
+  adler.update(Internet.host.getBytes());
+
+return (int) adler.getValue();
  }
   



You often use the result of an Adler32 checksum as hashCode() value.
Wouldn't it be more efficient to just simply xor the relevant fields? In
the followup patch you also correctly add the port number so in this
case it would be:

public int hashCode()
{
 int hash =3D 0;
 if (key !=3D null)
   for (int i =3D 0; i  key.length; i++)
 hash ^=3D key[i];
 if (Internet !=3D null  Internet.host !=3D null)
   {
 byte[] bs =3D Internet.host.getBytes();
 for (int i =3D 0; i  bs.length; i++)
   hash ^=3D bs[i];
 hash ^=3D Internet.port;
   }
 return hash;
}

Which seems more efficient. But maybe that isn't a good enough hash
function in this case and maybe using Adler32 isn't that much overhead.
Just wondering why you use it.

Cheers,

Mark

--=-UM7aozFctzAkjF67KfYe
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBDkFYGxVhZCJWr9QwRArLPAKCMfJbPTKy4tXFDruQ2mLAedTnKoQCfXeqv
NbZH7UqgoLhglO1GCqo3+Fo=
=8d4R
-END PGP SIGNATURE-

--=-UM7aozFctzAkjF67KfYe--



 





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


[cp-patches] FYI: Stopping the DefaultCaret timer when the component looses the focus.

2005-11-22 Thread Meskauskas Audrius
This should fix the resource leak, stopping the caret blinking timer 
when the caret looses the focus.


2005-11-22  Audrius Meskauskas  [EMAIL PROTECTED]

   * javax/swing/text/DefaultCaret.java (focusGained):
   Update timer status. (focusLost): Stop the timer
   (unless the event is temporary).
   (updateTimerStatus): New method.
   (setVisible): Delegate timer management to the updateTimerStatus.


Index: javax/swing/text/DefaultCaret.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.24
diff -u -r1.24 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java  17 Nov 2005 20:45:14 -  1.24
+++ javax/swing/text/DefaultCaret.java  22 Nov 2005 09:55:22 -
@@ -430,18 +430,45 @@
*/
   public void focusGained(FocusEvent event)
   {
-setVisible(true);
+setVisible(true);
+updateTimerStatus();
   }
 
   /**
* Sets the caret to codeinvisible/code.
-   *
+   * 
* @param event the codeFocusEvent/code
*/
   public void focusLost(FocusEvent event)
   {
 if (event.isTemporary() == false)
-  setVisible(false);
+  {
+setVisible(false);
+// Stop the blinker, if running.
+if (blinkTimer != null  blinkTimer.isRunning())
+  blinkTimer.stop();
+  }
+  }
+  
+  /**
+   * Install (if not present) and start the timer, if the caret must blink. The
+   * caret does not blink if it is invisible, or the component is disabled or
+   * not editable.
+   */
+  private void updateTimerStatus()
+  {
+if (visible  textComponent.isEnabled()  textComponent.isEditable())
+  {
+if (blinkTimer == null)
+  initBlinkTimer();
+if (!blinkTimer.isRunning())
+  blinkTimer.start();
+  }
+else
+  {
+if (blinkTimer != null)
+  blinkTimer.stop();
+  }
   }
 
   /**
@@ -870,18 +897,7 @@
 if (v != visible)
   {
 visible = v;
-if (visible)
-  if (textComponent.isEnabled()  textComponent.isEditable())
-{
-  if (blinkTimer == null)
-initBlinkTimer();
-  blinkTimer.start();
-}
-else
-  {
-if (blinkTimer != null)
-  blinkTimer.stop();
-  }
+updateTimerStatus();
 Rectangle area = null;
 try
   {
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: Stopping the DefaultCaret timer when the component looses the focus.

2005-11-22 Thread Meskauskas Audrius
Despite the current version always operates correctly, yes, the timer 
generally must be started regardless if the caret is now visible or not 
(it may get visible due blinking). I was also thinking about  the 
version where the visible property is not involved into the blinking 
process, but in this case the custom caret does not blink.


2005-11-22  Audrius Meskauskas  [EMAIL PROTECTED]

  * javax/swing/text/DefaultCaret.java (updateTimerStatus): Ignore 
the field visible.
Index: javax/swing/text/DefaultCaret.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.25
diff -u -r1.25 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java  22 Nov 2005 10:05:31 -  1.25
+++ javax/swing/text/DefaultCaret.java  22 Nov 2005 14:54:02 -
@@ -457,7 +457,7 @@
*/
   private void updateTimerStatus()
   {
-if (visible  textComponent.isEnabled()  textComponent.isEditable())
+if (textComponent.isEnabled()  textComponent.isEditable())
   {
 if (blinkTimer == null)
   initBlinkTimer();
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: Getting the system clipboard in javax/swing/TransferHandler

2005-11-22 Thread Meskauskas Audrius
Yes. But the problem was that 1) whenever there was any insecure 
access to the clipboard all successive calls would use this local clipboard.


Yes, if the situation changes in the way that the access to the system 
clipboard is now permitted, the system clipboard must be returned. This 
patch fixes this.


I am not sure about the security problem. If it is still dangerous to 
have the VM-local clipboard in this case, maybe to use the 
component-local clipboard? Or none?  Waiting for more opinions.


2005-11-22  Audrius Meskauskas  [EMAIL PROTECTED]

   * javax/swing/TransferHandler
   (getClipboard): Aways check for the possibility to 
	access the system clipboard.



Index: javax/swing/TransferHandler.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/TransferHandler.java,v
retrieving revision 1.11
diff -u -r1.11 TransferHandler.java
--- javax/swing/TransferHandler.java13 Nov 2005 20:18:42 -  1.11
+++ javax/swing/TransferHandler.java22 Nov 2005 15:01:36 -
@@ -84,28 +84,22 @@
  */
 private static Clipboard getClipboard(JComponent component)
 {
-  // Avoid throwing exception if the system clipboard access failed
-  // in the past.
-  if (clipboard != null)
-return clipboard;
-  else
+  try
 {
-  try
-{
-  SecurityManager sm = System.getSecurityManager();
-  if (sm != null)
-sm.checkSystemClipboardAccess();
+  SecurityManager sm = System.getSecurityManager();
+  if (sm != null)
+sm.checkSystemClipboardAccess();
 
-  // We may access system clipboard.
-  return component.getToolkit().getSystemClipboard();
-}
-  catch (Exception e)
-{
-  // We may not access system clipboard.
-  // Create VM-local clipboard if none exists yet.
-  clipboard = new Clipboard(Clipboard);
-  return clipboard;
-}
+  // We may access the system clipboard.
+  return component.getToolkit().getSystemClipboard();
+}
+  catch (Exception e)
+{
+  // We may not access system clipboard.
+  // Create VM-local clipboard if none exists yet.
+  if (clipboard == null)
+clipboard = new Clipboard(Clipboard);
+  return clipboard;
 }
 }
   }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: FreeSWTTestApps page added to wiki

2005-11-22 Thread Meskauskas Audrius

Egon Willighagen wrote:

Not implemented [need JDK 1.5 or greater] (java.lang.ClassNotFoundException: 
sun/awt/X11/XEmbeddedFrame)


 

The problem is, the application is using the proprietary Sun class  from 
the protected sun.* namespace. The Sun's license does not permit to add 
classes from this package. Also, the class is probably totally 
undocumented and we have no right to look into the Sun sources doing 
exactly the same.  If this does not come from Eclipse, we need can 
rewrite the calling code.


Best wishes
Audrius




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


Re: [cp-patches] FYI: Getting the system clipboard in javax/swing/TransferHandler

2005-11-19 Thread Meskauskas Audrius
The idea probably is that if we cannot get access to the system 
clipboard, we may still want to cut/copy/paste inside the same 
application  (for instance, to move the text fragment in the text area 
being currently edited). With the local clipboard, the application can 
only read the clipboard data that it have placed there itself. With the 
system clipboard, the application may have access on some data that are 
just accidently remaining there;  it is probably possible to steal a 
valuable  information this way.


Audrius.

Mark Wielaard wrote:


Hi,

On Sun, 2005-11-13 at 21:06 +0100, Meskauskas Audrius wrote:
 

The private method getClipboard in TransferHandler was always returning 
the VM local clipboard and not the system clipboard in the case when the 
security manager is not installed (typical case).


With this patch, I am able to paste the external data from the system 
clipboard into the text field if manually calling the .paste() method 
   



This seems to work. But I don't understand why we are not just
completely ignoring the clipboard if we get a SecurityException. I would
propose the following patch that just makes the call to the Toolkit, the
Toolkit then does the security check, and if we get that we just ignore
the whole thing to prevent clipboard access by untrusted code.

2005-11-19  Mark Wielaard  [EMAIL PROTECTED]

   * javax/swing/TransferHandler
   (TransferAction.actionPerformed): Beep and return when clipboard
   is null.
   (getClipboard): Return null when access denied.
   (clipboard): Removed static field.

What do you think?
Also CCed to Gary since he was investigating security issues in general.

Cheers,

Mark
 




Index: javax/swing/TransferHandler.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/TransferHandler.java,v
retrieving revision 1.11
diff -u -r1.11 TransferHandler.java
--- javax/swing/TransferHandler.java13 Nov 2005 20:18:42 -  1.11
+++ javax/swing/TransferHandler.java19 Nov 2005 21:25:06 -
@@ -1,5 +1,5 @@
/* TransferHandler.java --
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

@@ -43,6 +43,7 @@
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
+import java.awt.Toolkit;
import java.io.Serializable;

public class TransferHandler implements Serializable
@@ -62,6 +63,13 @@
  TransferHandler transferHandler = component.getTransferHandler();
  Clipboard clipboard = getClipboard(component);

+  if (clipboard == null)
+   {
+ // Access denied!
+ Toolkit.getDefaultToolkit().beep();
+ return;
+   }
+
  if (command.equals(COMMAND_COPY))
transferHandler.exportToClipboard(component, clipboard, COPY);
  else if (command.equals(COMMAND_CUT))
@@ -76,37 +84,22 @@
}
  
/**

- * Get the system cliboard. If not available, create and return the 
VM-local
- * clipboard.
+ * Get the system cliboard or null if the caller isn't allowed to
+ * access the system clipboard.
 * 
 * @param component a component, used to get the toolkit.

 * @return the clipboard
 */
private static Clipboard getClipboard(JComponent component)
{
-  // Avoid throwing exception if the system clipboard access failed
-  // in the past.
-  if (clipboard != null)
-return clipboard;
-  else
-{
-  try
-{
-  SecurityManager sm = System.getSecurityManager();
-  if (sm != null)
-sm.checkSystemClipboardAccess();
-
-  // We may access system clipboard.
-  return component.getToolkit().getSystemClipboard();
-}
-  catch (Exception e)
-{
-  // We may not access system clipboard.
-  // Create VM-local clipboard if none exists yet.
-  clipboard = new Clipboard(Clipboard);
-  return clipboard;
-}
-}
+  try
+   {
+ return component.getToolkit().getSystemClipboard();
+   }
+  catch (SecurityException se)
+   {
+ return null;
+   }
}
  }
  
@@ -124,12 +117,6 @@

  private static Action copyAction = new TransferAction(COMMAND_COPY);
  private static Action cutAction = new TransferAction(COMMAND_CUT);
  private static Action pasteAction = new TransferAction(COMMAND_PASTE);
-  
-  /**

-   * Clipboard if system clipboard may not be used.
-   * Package-private to avoid an accessor method.
-   */
-  static Clipboard clipboard;
  
  private int sourceActions;

  private Icon visualRepresentation;
 





___
Classpath-patches mailing list
Classpath-patches@gnu.org
http

Re: New GNU Classpath developer Gary Benson

2005-11-18 Thread Meskauskas Audrius


Congratulations! Nice afternoon!

Audrius.



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


[cp-patches] FYI: Added not to CORBA examples readme.

2005-11-17 Thread Meskauskas Audrius
The note explains that there is no need to build the whole Classpath 
system just to build the examples.


2005-11-17  Audrius Meskauskas  [EMAIL PROTECTED]

* examples/gnu/classpath/examples/CORBA/swing/README.html: Added note 
about the build.
Index: examples/gnu/classpath/examples/CORBA/swing/README.html
===
RCS file: 
/cvsroot/classpath/classpath/examples/gnu/classpath/examples/CORBA/swing/README.html,v
retrieving revision 1.1
diff -u -r1.1 README.html
--- examples/gnu/classpath/examples/CORBA/swing/README.html 15 Nov 2005 
21:16:26 -  1.1
+++ examples/gnu/classpath/examples/CORBA/swing/README.html 17 Nov 2005 
09:20:48 -
@@ -47,6 +47,9 @@
   using RMI/IIOP machinery allowed to implement all this functionality
   with just 13 classes (plus 4 generated), all of them being rather
   simple.
+  
+  This example refers to the standard classes only and must be buildable
+  from your IDE as long as it has any java 1.4 compiler.   
 /p
 p
   The used IIOP protocol must ensure interoperability, allowing players
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] RFC:Modifying example build system.

2005-11-17 Thread Meskauskas Audrius
This patch makes the system to compile, zip and install the CORBA 
examples as well. The CORBA examples were not installed because they 
were placed in the more nested folders that expected by the build 
script. The patch should fix the PR 24911.


The patch fixes problem in a primitive way, by adding additional 
folders. The true solution would be to process all example tree of the 
arbitrary depth and install all files, named README (probably any 
extension). The current patch may be, however, better than nothing, as 
the users say they have problems.


This is the first time I need to modify the build system. Surely I 
tested what I did, but somebody with good experience in Classpath 
building could briefly look at the patch.


2005-11-17  Audrius Meskauskas  [EMAIL PROTECTED]

* classpath/examples/Makefile.am
(EXAMPLE_JAVA_FILES): Extended by /*/*/*.java and /*/*/*/*.java.
(READMES): New category.
(ALL_EXAMPLE_FILES): Extended by READMES category.


Index: examples/Makefile.am
===
RCS file: /cvsroot/classpath/classpath/examples/Makefile.am,v
retrieving revision 1.6
diff -u -r1.6 Makefile.am
--- examples/Makefile.am5 Sep 2005 08:31:03 -   1.6
+++ examples/Makefile.am17 Nov 2005 11:02:04 -
@@ -20,7 +20,7 @@
 endif
 
 # All our example java source files
-EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java
+EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java 
$(srcdir)/gnu/classpath/examples/*/*/*.java 
$(srcdir)/gnu/classpath/examples/*/*/*/*.java
 
 # The example C source files
 EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c
@@ -34,8 +34,11 @@
 # the png icons we use in some of the examples.
 EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
 
+# The example specific README files.
+READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
+
 # All the files we find interesting
-ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_ICONS)
+ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_ICONS) 
$(READMES)
 
 # Some architecture independent data to be installed.
 example_DATA = $(EXAMPLE_ZIP) README
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Prevent multiple lines in JTextField

2005-11-15 Thread Meskauskas Audrius
JTextField is always a single line component. In GNU Classpath, it is 
possible to make it multi line by setting or pasting the line with line 
feeds. While this is highly impressive, the Sun's implementation never 
does this, replacing the line feeds by spaces instead. The unwanted 
resizing of the component generally does not look well in the 
applications that do not expect this.


The simplest way to reach the identical behaviour is to override setText 
and replaceSelection, replacing (if present) line feeds and carriage 
returns by spaces.


2005-11-15  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/JTextField.java (setText, replaceSelection, filterString): 
New methods.


Index: javax/swing/JTextField.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextField.java,v
retrieving revision 1.26
diff -u -r1.26 JTextField.java
--- javax/swing/JTextField.java 31 Oct 2005 16:22:51 -  1.26
+++ javax/swing/JTextField.java 15 Nov 2005 10:09:24 -
@@ -511,4 +511,45 @@
 // javax.swing.text.FieldView.
 return horizontalVisibility;
   }
+  
+  /**
+   * JTextField is a single line component. The method replaces the line
+   * feeds by spaces.
+   */
+  public void replaceSelection(String content)
+  {
+super.replaceSelection(filterString(content));
+  }
+  
+  /**
+   * JTextField is a single line component. The method replaces the line
+   * feeds by spaces.
+   */
+  public void setText(String content)
+  {
+super.setText(filterString(content));
+  }
+  
+  /**
+   * Replaces line feeds and carriage returns by spaces.
+   * 
+   * @param content
+   */
+  String filterString(String content)
+  {
+if (content.indexOf('\n') = 0 || content.indexOf('\r') = 0)
+  {
+StringBuilder b = new StringBuilder(content);
+char c;
+for (int i = 0; i  b.length(); i++)
+  {
+c = b.charAt(i);
+if (c == '\n' || c == '\r')
+  b.setCharAt(i, ' ');
+  }
+return b.toString();
+  }
+else
+  return content;
+  }
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: Prevent multiple lines in JTextField

2005-11-15 Thread Meskauskas Audrius

Yes, your suggestion is the better way to fix that bug.

Roman Kennke wrote:


Hi again,

 

The simplest way to reach the identical behaviour is to override setText 
and replaceSelection, replacing (if present) line feeds and carriage 
returns by spaces.
   



I have looked into this. The simplest way is to do it in
PlainDocument.insertString(), exactly where I implemented this feature,
but asking for the filterNewlines of the document, just as the JDK does.
This should prevent newlines from going into JTextField when the
filterNewlines property is set on the document. Unfortunately this
property is never set, although it should be (on the JDK this property
is set to true by default).

I checked in the attached patch to fix this. This should also solve your
problem and there is no need to check in your patch.

2005-11-15  Roman Kennke  [EMAIL PROTECTED]

   * javax/swing/JTextField.java
   (createDefaultModel): Set the filterNewlines property on the
created
   model.

/Roman
 




Index: javax/swing/JTextField.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextField.java,v
retrieving revision 1.26
diff -u -r1.26 JTextField.java
--- javax/swing/JTextField.java 31 Oct 2005 16:22:51 -  1.26
+++ javax/swing/JTextField.java 15 Nov 2005 13:48:53 -
@@ -203,7 +203,9 @@
   */
  protected Document createDefaultModel()
  {
-return new PlainDocument();
+PlainDocument doc = new PlainDocument();
+doc.putProperty(filterNewlines, Boolean.TRUE);
+return doc;
  }

  /**
 





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


[cp-patches] FYI:gnu.CORBA.OrbFunctional fix.

2005-11-15 Thread Meskauskas Audrius

This fixes interoperability problems with Sun\s 1.5 jdk.

2005-11-15  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/OrbFunctional.java (serveStep):
Returning ensure that the socket is closed.
Index: gnu/CORBA/OrbFunctional.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/OrbFunctional.java,v
retrieving revision 1.3
diff -u -r1.3 OrbFunctional.java
--- gnu/CORBA/OrbFunctional.java10 Nov 2005 07:52:55 -  1.3
+++ gnu/CORBA/OrbFunctional.java15 Nov 2005 20:17:12 -
@@ -1612,6 +1612,18 @@
 // TODO log it.
 return;
   }
+finally
+  {
+try 
+  {
+if (service!=null  !service.isClosed())
+  service.close();
+  }
+catch (IOException ioex)
+  {
+// OK.
+  }
+  }
   }
   
   /**
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Releasing the first CORBA/Swing example ( two player network strategy game)

2005-11-15 Thread Meskauskas Audrius
 This example should demonstrate the work of CORBA  in the Swing based 
network game.The game  was popular in my student times.  After doing 
some web search I concluded that the game is called  Five-in-a-row in 
English.



Five-in-a-row is a two player strategy game. The players are connected 
via network using CORBA-based RMI/IIOP protocol and make they moves with 
the help of the Swing-based interface. While playing, the users can also 
chat.


The system consists of the single server and any number of 
interconnected players. The person, willing to play, starts the client 
and connects the server. The server redirects call to the partner that 
has previously connected the same server, also willing to play. Then 
both clients communicate directly with each other.


I also wrote README.html for game rules and installation details.

We managed to fix the majority of the Swing problems that prevented this 
application from running, but I the ctr-V (paste) is still not working 
at the moment. To work around, the application has the temporary paste 
button. The application is currently tested while running server and 
both clients on the same machine, not over network.  As such, it seems 
doing that expected. JamVM+current Classpath interoperates with Sun's 
1.5 implementation.



2005-11-15  Audrius Meskauskas  [EMAIL PROTECTED]

   * examples/gnu/classpath/examples/CORBA/swing/README.html,
   examples/gnu/classpath/examples/CORBA/swing/x5/CanvasWorld.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/ChatConstants.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/ClientFrame.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/Demo.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/GameManager.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/GameManagerImpl.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/IorReader.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/OrbStarter.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/Player.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/PlayerImpl.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/PlayingDesk.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/State.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/X5Server.java,
  
examples/gnu/classpath/examples/CORBA/swing/x5/_GameManagerImpl_Tie.java,

   examples/gnu/classpath/examples/CORBA/swing/x5/_GameManager_Stub.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/_PlayerImpl_Tie.java,
   examples/gnu/classpath/examples/CORBA/swing/x5/_Player_Stub.java: 
New files.


five.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] Patch: RFC: javax.sound.sampled

2005-11-13 Thread Meskauskas Audrius

+1

Audrius.




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


[cp-patches] FYI: CORBA 1.5 API fixes

2005-11-13 Thread Meskauskas Audrius

This adds several missing 1.5 methods.

2005-11-13  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/CORBA/Interceptor/gnuIorInfo.java (state): Made public.
   * gnu/CORBA/Interceptor/gnuServerRequestInfo.java
   (adapter_name, orb_id, server_id): New methods.
   * org/omg/PortableInterceptor/IORInfoOperations.java
   (state): New method.
   * org/omg/PortableInterceptor/ServerRequestInfoOperations.java
   (adapter_name, orb_id, server_id): New methods.
Index: gnu/CORBA/Interceptor/gnuIorInfo.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Interceptor/gnuIorInfo.java,v
retrieving revision 1.2
diff -u -r1.2 gnuIorInfo.java
--- gnu/CORBA/Interceptor/gnuIorInfo.java   11 Nov 2005 11:39:34 -  
1.2
+++ gnu/CORBA/Interceptor/gnuIorInfo.java   13 Nov 2005 09:40:36 -
@@ -115,7 +115,7 @@
   /**
* Return the state of the object POA.
*/
-  short state()
+  public short state()
   {
 return (short) poa.the_POAManager().get_state().value();
   }
Index: gnu/CORBA/Interceptor/gnuServerRequestInfo.java
===
RCS file: 
/cvsroot/classpath/classpath/gnu/CORBA/Interceptor/gnuServerRequestInfo.java,v
retrieving revision 1.1
diff -u -r1.1 gnuServerRequestInfo.java
--- gnu/CORBA/Interceptor/gnuServerRequestInfo.java 28 Aug 2005 11:23:37 
-  1.1
+++ gnu/CORBA/Interceptor/gnuServerRequestInfo.java 13 Nov 2005 09:53:02 
-
@@ -42,6 +42,7 @@
 import gnu.CORBA.GIOP.RequestHeader;
 import gnu.CORBA.ObjectCreator;
 import gnu.CORBA.Poa.gnuServantObject;
+import gnu.CORBA.OrbFunctional;
 import gnu.CORBA.Unexpected;
 import gnu.CORBA.gnuRequest;
 
@@ -453,4 +454,23 @@
   }
 return p;
   }
+
+  /** @inheritDoc */
+  public String[] adapter_name()
+  {
+return m_object.poa.getReferenceTemplate().adapter_name();
+  }
+
+  /** @inheritDoc */
+  public String orb_id()
+  {
+return m_object.orb.orb_id;
+  }
+
+  /** @inheritDoc */
+  public String server_id()
+  {
+return OrbFunctional.server_id;
+  }
+  
 }
Index: org/omg/PortableInterceptor/IORInfoOperations.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/IORInfoOperations.java,v
retrieving revision 1.3
diff -u -r1.3 IORInfoOperations.java
--- org/omg/PortableInterceptor/IORInfoOperations.java  11 Nov 2005 11:39:34 
-  1.3
+++ org/omg/PortableInterceptor/IORInfoOperations.java  13 Nov 2005 09:40:54 
-
@@ -124,4 +124,15 @@
* @see IORInterceptor_3_0Operations#adapter_manager_state_changed
*/
   public int manager_id();
+  
+  /**
+   * Get the state of the adapter manager.
+   * 
+   * @since 1.5
+   * 
+   * @return the state of the adapters to that the IOR being created belongs.
+   * One of the [EMAIL PROTECTED] HOLDING#value}, [EMAIL PROTECTED] 
DISCARDING#value},
+   * [EMAIL PROTECTED] INACTIVE#value} or [EMAIL PROTECTED] 
NON_EXISTENT#value}.
+   */
+  short state(); 
 }
Index: org/omg/PortableInterceptor/ServerRequestInfoOperations.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/ServerRequestInfoOperations.java,v
retrieving revision 1.1
diff -u -r1.1 ServerRequestInfoOperations.java
--- org/omg/PortableInterceptor/ServerRequestInfoOperations.java28 Aug 
2005 11:23:37 -  1.1
+++ org/omg/PortableInterceptor/ServerRequestInfoOperations.java13 Nov 
2005 09:49:44 -
@@ -216,7 +216,8 @@
  *
  * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
  */
-public interface ServerRequestInfoOperations extends RequestInfoOperations
+public interface ServerRequestInfoOperations
+  extends RequestInfoOperations
 {
   /**
* Allows the interceptor to add service contexts to the request. Such added
@@ -231,9 +232,7 @@
* @throws BAD_INV_ORDER minor 15 if the context with the same Id already
* exists and replace=false.
*/
-  void add_reply_service_context(ServiceContext service_context,
-boolean replace
-  );
+  void add_reply_service_context(ServiceContext service_context, boolean 
replace);
 
   /**
* Get the identifier for the object adapter (POA).
@@ -257,14 +256,15 @@
* @throws INV_POLICY minor 2 if no factory was registered to produce this
* type of policy or the policy is otherwise invalid.
*/
-  Policy get_server_policy(int type) throws INV_POLICY;
+  Policy get_server_policy(int type)
+throws INV_POLICY;
 
   /**
* Get the exception to be returned to the client. If the returned Any cannot
* not support holding of that exception, it holds
* [EMAIL PROTECTED] org.omg.CORBA.UNKNOWN} minor 1 instead.
*
-   * @return an Any, holding exception that has been thrown and will be 
returned
+   * @return an Any, holding exception that has been thrown and will be 
returned
* to client.
*/
   Any 

[cp-patches] FYI: Getting the system clipboard in javax/swing/TransferHandler

2005-11-13 Thread Meskauskas Audrius
The private method getClipboard in TransferHandler was always returning 
the VM local clipboard and not the system clipboard in the case when the 
security manager is not installed (typical case).


With this patch, I am able to paste the external data from the system 
clipboard into the text field if manually calling the .paste() method 
(test case for PR 24733 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24733). Ctrl-V still does 
not show any signs of life.


PR 24733 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24733
2005-11-13  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/TransferHandler.java (getClipboard): Rewritten.

Index: javax/swing/TransferHandler.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/TransferHandler.java,v
retrieving revision 1.10
diff -u -r1.10 TransferHandler.java
--- javax/swing/TransferHandler.java19 Oct 2005 15:45:05 -  1.10
+++ javax/swing/TransferHandler.java13 Nov 2005 19:19:44 -
@@ -75,30 +75,38 @@
}
 }
   
+/**
+ * Get the system cliboard. If not available, create and return the 
VM-local
+ * clipboard.
+ * 
+ * @param component a component, used to get the toolkit.
+ * @return the clipboard
+ */
 private static Clipboard getClipboard(JComponent component)
 {
-  SecurityManager sm = System.getSecurityManager();
-
-  if (sm != null)
-   {
- try
-   {
- sm.checkSystemClipboardAccess();
+  // Avoid throwing exception if the system clipboard access failed
+  // in the past.
+  if (clipboard != null)
+return clipboard;
+  else
+{
+  try
+{
+  SecurityManager sm = System.getSecurityManager();
+  if (sm != null)
+sm.checkSystemClipboardAccess();
 
- // We may access system clipboard.
- return component.getToolkit().getSystemClipboard();
-   }
- catch (SecurityException e)
-   {
- // We may not access system clipboard.
-   }
-   }
-
-  // Create VM-local clipboard if non exists yet.
-  if (clipboard == null)
-clipboard = new Clipboard(Clipboard);
-
-  return clipboard;
+  // We may access system clipboard.
+  return component.getToolkit().getSystemClipboard();
+}
+  catch (Exception e)
+{
+  // We may not access system clipboard.
+  // Create VM-local clipboard if none exists yet.
+  clipboard = new Clipboard(Clipboard);
+  return clipboard;
+}
+}
 }
   }
   
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Partial fix of 24749 (selection background is always black).

2005-11-12 Thread Meskauskas Audrius
This patch changes selection background color into correct one. The 
selected text is now visible  in Metal and Ocean LF. It is still not 
visible in GNU LF because the selection background in this LF is black 
anyway. The foreground must be white, but for some reason stays black, 
despite the that property is correctly defined.


PR 24749
2005-11-13  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/plaf/basic/BasicTextUI.java (installDefaults):  Call 
setSelectionColor.



Index: javax/swing/plaf/basic/BasicTextUI.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.53
diff -u -r1.53 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java 9 Nov 2005 10:22:34 -   
1.53
+++ javax/swing/plaf/basic/BasicTextUI.java 12 Nov 2005 22:22:26 -
@@ -557,6 +557,7 @@
 textComponent.setDisabledTextColor
  (UIManager.getColor(prefix + .inactiveForeground));
 textComponent.setSelectedTextColor(UIManager.getColor(prefix + 
.selectionForeground));
+textComponent.setSelectionColor(UIManager.getColor(prefix + 
.selectionBackground));
   }
 
   /**
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Updgrading CORBA interceptor system to CORBA 3.0.3 (jdk 1.5)

2005-11-11 Thread Meskauskas Audrius

This patch introduces IORInterceptor_3_0.java that appears from jdk 1.5 and
implements changes, required for this class to work.

2005-11-11  Audrius Meskauskas  [EMAIL PROTECTED]

   * org/omg/PortableInterceptor/IORInterceptor_3_0.java,
   org/omg/PortableInterceptor/IORInterceptor_3_0Helper.java,
   org/omg/PortableInterceptor/IORInterceptor_3_0Holder.java,
   org/omg/PortableInterceptor/IORInterceptor_3_0Operations.java,
   org/omg/PortableInterceptor/_IORInterceptor_3_0Stub.java: New files.

   * gnu/CORBA/Interceptor/IORInterceptors.java,
   gnu/CORBA/Interceptor/gnuIorInfo.java,
   gnu/CORBA/OrbRestricted.java,
   gnu/CORBA/Poa/AOM.java,
   gnu/CORBA/Poa/ORB_1_4.java,
   gnu/CORBA/Poa/gnuPOA.java,
   gnu/CORBA/Poa/gnuPOAManager.java,
   org/omg/PortableInterceptor/IORInfoOperations.java,
   org/omg/PortableInterceptor/IORInterceptorOperations.java,
   org/omg/PortableInterceptor/ORBInitInfoOperations.java,
   org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java:
   Rewritten to support the IORInterceptor_3_0.


Interceptors5.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: Nasty problem in javax.swing.Timer.restart()

2005-11-10 Thread Meskauskas Audrius
Thanks for idea. The problem seems real and the solution may work. Nice 
patch, also. I have several suggestions:


1.The Waker.run has two queueLock.wait statements. If the thread is 
interrupted (notified)
at the second waiting statement (inside the loop), the interrupting 
flag in your patch is not
reset to false. The application will hang in the endless loop inside the 
Timer.start().


Probably the flag should be reset to false inside the finally {}, where 
the  running is reset to false.


2. The private methods  isInterrupting() and setInterrupting() probably 
need not be synchronized as

they just get/set a single boolean field.

3. You code formatting exactly follows Sun style. This project uses GNU 
style. Try to reformat like the rest of the

class and also other Classpath classes and also as described in
http://www.gnu.org/software/classpath/docs/hacking.html.

4. Try to document the new methods you introduce.

5. You are not in the project member list. We must register everybody 
here; contact Mark ( [EMAIL PROTECTED] 
https://savannah.gnu.org/sendmessage.php?touser=301)
to get the form to sign and a couple of cute gnu images. Before that, we 
cannot apply the patch.


Best regards.

Audrius.
*

Joao Victor wrote:


Yesterday i posted this bug about tooltips appearing too fast:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24763

However, i was taking a look at the ToolTipManager.java source, and
noticed the logic apparently is already there.

So i started investigating the problem, and found something. In a few
words: ToolTipManager uses javax.swing.Timer to schedule the
appearance of the tooltip, as you may know. The problem happens
because when it calls Timer.restart(), restart() starts a new thread
before _really_ stopping the previous one.

It calls:
stop()
start()

However, because of the whole nature of wait/notifys/threads, when
that start() is executed, stop() has only notified the other thread -
it doesn't mean the other thread _really_ stopped.

So, you end up with 2 threads in the 'start' state. One of them will
block at the 'wait()' code, the other just moves on and shows the
tooltip -- too early.

The attached patch i'm sending apparently fixes this problem. I don't
know if it's the best way to fix it, though; take a look at what it
does and see if it's useful.

Cheers,
J.V.
 




--- javax/swing/Timer.java  2005-11-10 15:09:08.224949882 +
+++ javax/swing/Timer.java-jv   2005-11-10 15:07:12.523395499 +
@@ -78,8 +78,10 @@
  // Ignored
}

-  if (!running)
+  if (!running) {
+   setInterrupting(false);
return;
+  }

  queueEvent();

@@ -159,6 +161,7 @@
   * as scheduled. Should only be checked/set with queueLock held.
   */
  boolean running;
+  private boolean interrupting = false;

  /**
   * The delay between subsequent repetetive events.
@@ -379,6 +382,14 @@
return running;
  }

+  private synchronized void setInterrupting(boolean aStatus) {
+interrupting = aStatus;
+  }
+
+  private synchronized boolean isInterrupting() {
+return interrupting;
+  }
+
  /**
   * Add the action listener
   *
@@ -414,6 +425,17 @@
   */
  public void start()
  {
+
+while (isInterrupting()) {
+   //do nothing
+   try {
+  synchronized (queueLock) {
+ queueLock.notifyAll();
+ }
+   } catch(Exception e) {
+   }
+}
+
synchronized (queueLock)
  {
if (!running)
@@ -432,6 +454,7 @@
  {
synchronized (queueLock)
  {
+   setInterrupting(true);
running = false;
queue = 0;
queueLock.notifyAll();
 




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





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


[cp-patches] FYI: ObjectReferenceFactory API fix.

2005-11-09 Thread Meskauskas Audrius

2005-11-09  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/PortableInterceptor/ObjectReferenceFactory.java: Do not inherit
from org.omg.CORBA.Object
Index: org/omg/PortableInterceptor/ObjectReferenceFactory.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/ObjectReferenceFactory.java,v
retrieving revision 1.1
diff -u -r1.1 ObjectReferenceFactory.java
--- org/omg/PortableInterceptor/ObjectReferenceFactory.java 26 Oct 2005 
20:57:54 -  1.1
+++ org/omg/PortableInterceptor/ObjectReferenceFactory.java 9 Nov 2005 
15:37:12 -
@@ -52,6 +52,6 @@
  * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
  */
 public interface ObjectReferenceFactory
-  extends ObjectReferenceFactoryOperations, IDLEntity, org.omg.CORBA.Object
+  extends ObjectReferenceFactoryOperations, IDLEntity
 {
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: New 1.5 CORBA classes.

2005-11-09 Thread Meskauskas Audrius

2005-11-09  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/PortableInterceptor/ObjectReferenceTemplate.java,
* org/omg/PortableInterceptor/ObjectReferenceTemplateHelper.java,
* org/omg/PortableInterceptor/ObjectReferenceTemplateHolder.java:
New files.



ObjectReferenceTemplate.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Two more CORBA classes

2005-11-09 Thread Meskauskas Audrius

2005-11-09  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHelper.java,
* org/omg/PortableInterceptor/ObjectReferenceTemplateSeqHolder.java:
New files.
/* ObjectReferenceTemplateSeqHolder.java --
   Copyright (C) 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
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 org.omg.PortableInterceptor;

import org.omg.CORBA.portable.Streamable;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;

/**
 * A holder for the array of [EMAIL PROTECTED] ObjectReferenceTemplate}s.
 * 
 * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
 */
public class ObjectReferenceTemplateSeqHolder
  implements Streamable
{
  /**
   * The stored ObjectReferenceTemplate value.
   */
  public ObjectReferenceTemplate[] value;

  /**
   * Create the unitialised instance, leaving the value field with default
   * codenull/code value.
   */
  public ObjectReferenceTemplateSeqHolder()
  {
  }

  /**
   * Create the initialised instance.
   * 
   * @param initialValue the value that will be assigned to the
   * codevalue/code field.
   */
  public ObjectReferenceTemplateSeqHolder(ObjectReferenceTemplate[] initialValue)
  {
value = initialValue;
  }

  /**
   * Fill in the [EMAIL PROTECTED] value} by data from the CDR stream.
   * 
   * @param input the org.omg.CORBA.portable stream to read.
   */
  public void _read(InputStream input)
  {
value = ObjectReferenceTemplateSeqHelper.read(input);
  }

  /**
   * Write the stored value into the CDR stream.
   * 
   * @param output the org.omg.CORBA.portable stream to write.
   */
  public void _write(OutputStream output)
  {
ObjectReferenceTemplateSeqHelper.write(output, value);
  }

  /**
   * Get the typecode of the ObjectReferenceTemplate.
   */
  public org.omg.CORBA.TypeCode _type()
  {
return ObjectReferenceTemplateSeqHelper.type();
  }
}
/*  ObjectReferenceTemplateSeqHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  

[cp-patches] FYI: Clone parameter Dimension in JComponent setters.

2005-11-08 Thread Meskauskas Audrius
Our setMaximumSize, setMinimumSize, setPreferredSize do not clone the 
passed parameter, assigning it directly. If the user program reuses the 
passed object (for instance, to set the same property with different 
values for another component), the modifications both in Classpath and 
the user code cause the improper work.


Despite the current version produces less garbage, and very simple 
workaround is possible, Sun seems cloning the values (later changes on 
parameter have no effect).


This patch makes our behaviour consistent with Sun's.

2005-11-08  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/JComponent.java (setMaximumSize, setMinimumSize, 
setPreferredSize):

Clone the passed parameter.
Index: javax/swing/JComponent.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.75
diff -u -r1.75 JComponent.java
--- javax/swing/JComponent.java 2 Nov 2005 19:26:33 -   1.75
+++ javax/swing/JComponent.java 8 Nov 2005 10:18:42 -
@@ -2435,38 +2435,44 @@
   }
 
   /**
-   * Set the value of the [EMAIL PROTECTED] #maximumSize} property.
+   * Set the value of the [EMAIL PROTECTED] #maximumSize} property. The passed 
value is
+   * copied, the later direct changes on the argument have no effect on the
+   * property value.
*
* @param max The new value of the property
*/
   public void setMaximumSize(Dimension max)
   {
 Dimension oldMaximumSize = maximumSize;
-maximumSize = max;
+maximumSize = new Dimension(max);
 firePropertyChange(maximumSize, oldMaximumSize, maximumSize);
   }
 
   /**
-   * Set the value of the [EMAIL PROTECTED] #minimumSize} property.
+   * Set the value of the [EMAIL PROTECTED] #minimumSize} property. The passed 
value is
+   * copied, the later direct changes on the argument have no effect on the
+   * property value.
*
* @param min The new value of the property
*/
   public void setMinimumSize(Dimension min)
   {
 Dimension oldMinimumSize = minimumSize;
-minimumSize = min;
+minimumSize = new Dimension(min);
 firePropertyChange(minimumSize, oldMinimumSize, minimumSize);
   }
 
   /**
-   * Set the value of the [EMAIL PROTECTED] #preferredSize} property.
+   * Set the value of the [EMAIL PROTECTED] #preferredSize} property. The 
passed value is
+   * copied, the later direct changes on the argument have no effect on the
+   * property value.
*
* @param pref The new value of the property
*/
   public void setPreferredSize(Dimension pref)
   {
 Dimension oldPreferredSize = preferredSize;
-preferredSize = pref;
+preferredSize = new Dimension(pref);
 firePropertyChange(preferredSize, oldPreferredSize, preferredSize);
   }
 
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Fix for 24730 (Phlegmatic work)

2005-11-08 Thread Meskauskas Audrius
This patch implements the caret blinking behavior that is usually 
observed in the most of applications: after any change of the caret 
position it immediately reappears and do no go down again earlier than 
the full timer blinking interval. Under very intensive work, the caret 
does not blink.


The text  selection (shift+arrow keys) is also working better, despite 
the default selection color is black for some strange reason.


2005-11-08  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/swing/DefaultCaret.java (BlinkTimerListener):  added 
ignoreNextEvent flag and its handling.
(blinkListener): New field. (initBlinkTimer): Initialise blinkListener 
field.

(setDot, moveDot): Call appear() instead of repaint(). (appear): new method.

Index: javax/swing/text/DefaultCaret.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/text/DefaultCaret.java,v
retrieving revision 1.22
diff -u -r1.22 DefaultCaret.java
--- javax/swing/text/DefaultCaret.java  3 Nov 2005 23:19:34 -   1.22
+++ javax/swing/text/DefaultCaret.java  8 Nov 2005 23:38:08 -
@@ -74,19 +74,33 @@
* Controls the blinking of the caret.
*
* @author Roman Kennke ([EMAIL PROTECTED])
+   * @author Audrius Meskauskas ([EMAIL PROTECTED])
*/
   private class BlinkTimerListener implements ActionListener
   {
 /**
+ * Forces the next event to be ignored. The next event should be ignored
+ * if we force the caret to appear. We do not know how long will it take
+ * to fire the comming event; this may be near immediately. Better to leave
+ * the caret visible one iteration longer.
+ */
+boolean ignoreNextEvent;
+
+/**
  * Receives notification when the blink timer fires and updates the visible
  * state of the caret.
- *
+ * 
  * @param event the action event
  */
 public void actionPerformed(ActionEvent event)
 {
-  visible = !visible;
-  repaint();
+  if (ignoreNextEvent)
+ignoreNextEvent = false;
+  else
+{
+  visible = !visible;
+  repaint();
+}
 }
   }
 
@@ -274,6 +288,8 @@
   private Object highlightEntry;
 
   private Timer blinkTimer;
+  
+  private BlinkTimerListener blinkListener;
 
   /**
* Creates a new codeDefaultCaret/code instance.
@@ -768,7 +784,7 @@
 this.dot = dot;
 handleHighlight();
 adjustVisibility(this);
-repaint();
+appear();
   }
 
   /**
@@ -786,8 +802,44 @@
 this.mark = dot;
 handleHighlight();
 adjustVisibility(this);
-repaint();
+appear();
   }
+  
+  /**
+   * Show the caret (may be hidden due blinking) and adjust the timer not to
+   * hide it (possibly immediately).
+   * 
+   * @author Audrius Meskauskas ([EMAIL PROTECTED])
+   */
+  void appear()
+  {
+// All machinery is only required if the carret is blinking.
+if (blinkListener != null)
+  {
+blinkListener.ignoreNextEvent = true;
+
+// If the caret is visible, erase the current position by repainting
+// over.
+if (visible)
+  repaint();
+
+// Draw the caret in the new position.
+visible = true;
+
+Rectangle area = null;
+try
+  {
+area = getComponent().modelToView(getDot());
+  }
+catch (BadLocationException ex)
+  {
+assert false : Unexpected bad caret location:  + getDot();
+  }
+if (area != null)
+  damage(area);
+  }
+repaint();
+  }  
 
   /**
* Returns codetrue/code if this codeCaret/code is currently visible,
@@ -888,7 +940,8 @@
   private void initBlinkTimer()
   {
 // Setup the blink timer.
-blinkTimer = new Timer(getBlinkRate(), new BlinkTimerListener());
+blinkListener = new BlinkTimerListener();
+blinkTimer = new Timer(getBlinkRate(), blinkListener);
 blinkTimer.setRepeats(true);
   }
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: New TextField demo

2005-11-07 Thread Meskauskas Audrius
2) Clicking somewhere in the text doesn't move the cursor to that 
point - this is a regression.


This is a rather strange regression because the ordinary JTextField with 
absolutely no tricks in from the test case 24650 handles the mouse 
clicks correctly, and the Swing demo does not. This may be the hint to 
the real reason of the bug, probably the reason is that some custom 
property is set.






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


[cp-patches] FYI:Implementing http://, ftp:// and file:// for org.omg.CORBA.ORB.string_to_object(String)

2005-11-06 Thread Meskauskas Audrius
This patch adds support for the three protocols that must be supported 
by this method as defined in CORBA 3.0.3 (formal/04-03-12). The 
requirement is to read from the specified location a string that must be 
the address string, finally following one of the older standards of the 
stringified object reference.


2005-11-06  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/CORBA/Minor.java (IOR_missing): New minor code.
   gnu/CORBA/NamingService/NameParser.java (corbaloc): Implemented
   file//, ftp:// and http:// support,
   gnu/javax/rmi/CORBA/UtilDelegateImpl.java (mapSystemException):
   Set the cause directly.
   org/omg/CORBA/DATA_CONVERSION.java,
   org/omg/CORBA/ORB.java (string_to_object): Documentation update.

Index: gnu/CORBA/Minor.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Minor.java,v
retrieving revision 1.2
diff -u -r1.2 Minor.java
--- gnu/CORBA/Minor.java5 Oct 2005 16:25:42 -   1.2
+++ gnu/CORBA/Minor.java6 Nov 2005 10:08:04 -
@@ -272,5 +272,11 @@
* submitting large number of requests.
*/
   int Threads = 21 | vendor;
+  
+  /**
+   * The IOR starts with file://, http:// or ftp://, but this local or remote
+   * resource is not accessible.
+   */
+  int Missing_IOR = 22 | vendor;
 
 }
Index: gnu/CORBA/NamingService/NameParser.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/NamingService/NameParser.java,v
retrieving revision 1.5
diff -u -r1.5 NameParser.java
--- gnu/CORBA/NamingService/NameParser.java 28 Oct 2005 14:05:21 -  
1.5
+++ gnu/CORBA/NamingService/NameParser.java 6 Nov 2005 11:00:26 -
@@ -38,6 +38,7 @@
 
 package gnu.CORBA.NamingService;
 
+import gnu.CORBA.Minor;
 import gnu.CORBA.OrbFunctional;
 import gnu.CORBA.IOR;
 import gnu.CORBA.Unexpected;
@@ -53,7 +54,13 @@
 import org.omg.CosNaming.NamingContext;
 import org.omg.CosNaming._NamingContextStub;
 
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.StringTokenizer;
@@ -88,6 +95,21 @@
* The IOR prefix.
*/
   public static final String pxIOR = ior;
+  
+  /**
+   * The file:// prefix.
+   */
+  public static final String pxFILE = file://;
+  
+  /**
+   * The ftp:// prefix.
+   */
+  public static final String pxFTP = ftp://;;
+  
+  /**
+   * The http:// prefix.
+   */
+  public static final String pxHTTP = http://;;
 
   /**
* Marks iiop protocol.
@@ -132,6 +154,9 @@
* 2. corbaloc:rir:[/key] br
* 3. corbaname:[EMAIL PROTECTED]:host[:port]/key br
* 4. corbaname:rir:[/key] br
+   * 5. file://[file name]br
+   * 6. http://[url]br
+   * 7. ftp://[url]br
* 
* Protocol defaults to IOP, the object key defaults to the NameService.
* 
@@ -144,6 +169,28 @@
 OrbFunctional orb)
 throws BAD_PARAM
   {
+return corbaloc(corbaloc, orb, 0);
+  }
+  
+  /**
+   * Parse controlling against the infinite recursion loop.
+   */
+  private org.omg.CORBA.Object corbaloc(String corbaloc,
+OrbFunctional orb, int recursion)
+  {
+// The used CORBA specification does not state how many times we should to
+//redirect, but the infinite loop may be used to knock out the system.
+// by malicious attempt.
+if (recursion  10)
+  throw new DATA_CONVERSION(More than 10 redirections);
+
+if (corbaloc.startsWith(pxFILE))
+  return corbaloc(readFile(corbaloc.substring(pxFILE.length())), orb, 
recursion+1);
+else if (corbaloc.startsWith(pxHTTP))
+  return corbaloc(readUrl(corbaloc), orb, recursion+1);
+else if (corbaloc.startsWith(pxFTP))
+  return corbaloc(readUrl(corbaloc), orb, recursion+1);
+
 boolean corbaname;
 
 // The alternative addresses, if given.
@@ -301,6 +348,70 @@
 
 else
   throw new DATA_CONVERSION(Unsupported protocol ' + t[p] + ');
+  }
+  
+  /**
+   * Read IOR from the file in the local file system.
+   */
+  String readFile(String file)
+  {
+File f = new File(file);
+if (!f.exists())
+  {
+DATA_CONVERSION err = new DATA_CONVERSION(f.getAbsolutePath()
+  +  does not exist.);
+err.minor = Minor.Missing_IOR;
+  }
+try
+  {
+char[] c = new char[(int) f.length()];
+FileReader fr = new FileReader(f);
+fr.read(c);
+fr.close();
+return new String(c).trim();
+  }
+catch (IOException ex)
+  {
+DATA_CONVERSION d = new DATA_CONVERSION();
+d.initCause(ex);
+d.minor = Minor.Missing_IOR;
+throw (d);
+  }
+  }
+  
+  /**
+   * Read IOR from the remote URL.
+   */
+  String readUrl(String url)
+  {
+URL u;
+try
+  {
+u = new URL(url);
+  }

[cp-patches] FYI: Fixes in org.omg.CORBA.Object._is_equivalent.

2005-11-06 Thread Meskauskas Audrius
This method provides better functionality for the 
org.omg.CORBA.Object._is_equivalent.
If the objects are remote, it is still possible to check if they are 
equivalent by comparing

the host and object key information.

2005-11-06  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/IOR.java (equals, hashCode): New methods.
* gnu/CORBA/SimpleDelegate.java (is_equivalent): Compare IORs when 
applicable.


Index: gnu/CORBA/IOR.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/IOR.java,v
retrieving revision 1.9
diff -u -r1.9 IOR.java
--- gnu/CORBA/IOR.java  28 Oct 2005 14:05:21 -  1.9
+++ gnu/CORBA/IOR.java  6 Nov 2005 13:12:52 -
@@ -59,6 +59,8 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.zip.Adler32;
 
 /**
  * The implementaton of the Interoperable Object Reference (IOR). IOR can be
@@ -715,5 +717,45 @@
 else
   // The future supported tagged profiles should be added here.
   throw new BAD_PARAM(Unsupported profile type  + profile.tag);
+  }
+  
+  /**
+   * Checks for equality.
+   */
+  public boolean equals(Object x)
+  {
+if (x instanceof IOR)
+  {
+boolean keys;
+boolean hosts = true;
+
+IOR other = (IOR) x;
+if (key != null  other.key != null)
+  keys = Arrays.equals(key, other.key);
+else
+  keys = key == other.key;
+
+if (Internet != null  Internet.host != null)
+  if (other.Internet != null  other.Internet.host != null)
+hosts = other.Internet.host.equals(Internet.host);
+
+return keys  hosts;
+  }
+else
+  return false;
+  }
+  
+  /**
+   * Get the hashcode of this IOR.
+   */
+  public int hashCode()
+  {
+Adler32 adler = new Adler32();
+if (key != null)
+  adler.update(key);
+if (Internet != null  Internet.host != null)
+  adler.update(Internet.host.getBytes());
+
+return (int) adler.getValue();
   }
 }
Index: gnu/CORBA/SimpleDelegate.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/SimpleDelegate.java,v
retrieving revision 1.1
diff -u -r1.1 SimpleDelegate.java
--- gnu/CORBA/SimpleDelegate.java   28 Oct 2005 12:04:39 -  1.1
+++ gnu/CORBA/SimpleDelegate.java   6 Nov 2005 12:50:40 -
@@ -196,13 +196,11 @@
   }
 
   /**
-   * Returns true if the objects are the same of have
-   * the same delegate set. All objects in this implementation
-   * have a separate delegate.
+   * Returns true if the objects are the same or have the same delegate set. 
All
+   * objects in this implementation have a separate delegate.
*/
   public boolean is_equivalent(org.omg.CORBA.Object target,
-   org.omg.CORBA.Object other
-  )
+org.omg.CORBA.Object other)
   {
 if (target == other)
   return true;
@@ -210,13 +208,25 @@
   {
 try
   {
-org.omg.CORBA.portable.Delegate a =
-  ((ObjectImpl) target)._get_delegate();
-org.omg.CORBA.portable.Delegate b =
-  ((ObjectImpl) other)._get_delegate();
+org.omg.CORBA.portable.Delegate a = ((ObjectImpl) 
target)._get_delegate();
+org.omg.CORBA.portable.Delegate b = ((ObjectImpl) 
other)._get_delegate();
 if (a == b)
   {
 return true;
+  }
+else
+  {
+// We compere the IOR's in this case.
+if (a instanceof IorProvider  b instanceof IorProvider)
+  {
+IOR ia = ((IorProvider) a).getIor();
+IOR ib = ((IorProvider) b).getIor();
+
+if (ia != null  ib != null)
+  return (ia.equals(ib));
+else
+  return ia == ib;
+  }
   }
 if (a != null  b != null)
   {
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: gnu.CORBA.IOR fix.

2005-11-06 Thread Meskauskas Audrius

2005-11-07  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/IOR.java (equals, hasCode): Compare port number as well
and do not crash on .Internet==null.

Index: gnu/CORBA/IOR.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/IOR.java,v
retrieving revision 1.10
diff -u -r1.10 IOR.java
--- gnu/CORBA/IOR.java  6 Nov 2005 13:26:24 -   1.10
+++ gnu/CORBA/IOR.java  7 Nov 2005 07:32:48 -
@@ -730,6 +730,10 @@
 boolean hosts = true;
 
 IOR other = (IOR) x;
+
+if (Internet==null || other.Internet==null)
+  return Internet == other.Internet;
+
 if (key != null  other.key != null)
   keys = Arrays.equals(key, other.key);
 else
@@ -739,7 +743,7 @@
   if (other.Internet != null  other.Internet.host != null)
 hosts = other.Internet.host.equals(Internet.host);
 
-return keys  hosts;
+return keys  hosts  Internet.port==other.Internet.port;
   }
 else
   return false;
@@ -753,9 +757,12 @@
 Adler32 adler = new Adler32();
 if (key != null)
   adler.update(key);
-if (Internet != null  Internet.host != null)
-  adler.update(Internet.host.getBytes());
-
+if (Internet != null)
+  {
+if (Internet.host != null)
+  adler.update(Internet.host.getBytes());
+adler.update(Internet.port);
+  }
 return (int) adler.getValue();
   }
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: New GNU Classpath developer Wolfgang Baer

2005-11-06 Thread Meskauskas Audrius

Wonderful evening today!

Audrius Meskauskas




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


Re:Re: [cp-patches] FYI: Stability fix for gnu/CORBA/SocketRepository: Patch attached to fix this.

2005-11-04 Thread Meskauskas Audrius

Thanks Mark for noticing the  synchronization bug.

Audrius.

2005-11-04  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/CORBA/SocketRepository.java (sockets): Changed type to
   HashMap. (put_socket, get_socket, gc):
   Always synchronize on 'sockets'.

Index: gnu/CORBA/SocketRepository.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/SocketRepository.java,v
retrieving revision 1.4
diff -u -r1.4 SocketRepository.java
--- gnu/CORBA/SocketRepository.java 31 Oct 2005 11:24:18 -  1.4
+++ gnu/CORBA/SocketRepository.java 4 Nov 2005 21:24:14 -
@@ -40,7 +40,7 @@
 
 import java.net.Socket;
 import java.net.SocketException;
-import java.util.Hashtable;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -56,7 +56,7 @@
   /**
* The socket map.
*/
-  private static Hashtable sockets = new Hashtable();
+  private static HashMap sockets = new HashMap();
   
   /**
* Put a socket. This method also discards all not reusable sockets from
@@ -68,14 +68,18 @@
*/
   public static void put_socket(Object key, Socket s)
   {
-sockets.put(key, s);
-gc();
+synchronized (sockets)
+  {
+sockets.put(key, s);
+gc();
+  }
   }
   
   /**
-   * Removes all non reusable sockets.
+   * Removes all non reusable sockets. As it is private,
+   * we know we call from the synchronized code already. 
*/
-  public static void gc()
+  private static void gc()
   {
 Iterator iter = sockets.entrySet().iterator();
 
@@ -107,38 +111,41 @@
* @param key a socket key.
* 
* @return an opened socket for reuse, null if no such available or it is
-   * closed, its input or output has been shutown or otherwise the socket
-   * is not reuseable.
+   * closed, its input or output has been shutown or otherwise the socket is 
not
+   * reuseable.
*/
   public static Socket get_socket(Object key)
   {
 if (true)
   return null;
-
-Socket s = (Socket) sockets.get(key);
-if (s == null)
-  return null;
-
-// Ensure that the socket is fully reusable.
-else if (not_reusable(s))
-  {
-sockets.remove(key);
-return null;
-  }
-else
+
+synchronized (sockets)
   {
-try
+Socket s = (Socket) sockets.get(key);
+if (s == null)
+  return null;
+
+// Ensure that the socket is fully reusable.
+else if (not_reusable(s))
   {
-// Set one minute time out that will be changed later.
-s.setSoTimeout(60*1000);
+sockets.remove(key);
+return null;
   }
-catch (SocketException e)
+else
   {
-s = null;
+try
+  {
+// Set one minute time out that will be changed later.
+s.setSoTimeout(60 * 1000);
+  }
+catch (SocketException e)
+  {
+s = null;
+  }
+
+sockets.remove(key);
+return s;
   }
-
-sockets.remove(key);
-return s;
   }
   }
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] RFC: Suggested change in PlainView.

2005-11-03 Thread Meskauskas Audrius
Our JTextField contains an imaginary end of line character (0xA), but 
the new text must be always inserted before it, not after. When clicking 
right from the last character in the field, the 
PlainTextView.viewToModel should return the position before the end of 
line character and not after the end of line character. Otherwise the 
inputs blocks. If the empty field receives focus by the mouse click, the 
caret position is always set after the 0xA and, a result, it is never 
possible to enter any text in the field.


The bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24650 has the 
uploaded test case, demonstrating this problem.


This path fixes the problem by introducing the following rule: if the 
last character under the mouse click is 0xA, it should not be taken into 
consideration, the pre-last character must be returned instead (the 0xA 
is a dimensionless character anyway).


With this patch, I revived the text fields in my application. In the 
swing activity board, now it is possible to enter the text after 
clicking the mouse RIGHT from the Hello world in the text field demo. 
The work of the rest of Swing seems not broken, despite it would be nice 
if somebody else could check this as well.


2005-11-03  Audrius Meskauskas  [EMAIL PROTECTED]

PR swing/24650
* javax/swing/text/PlainView.java (viewToModel)):
The end of line symbol (0xA), if being the last member in the obtained 
text, should not be counted.
Index: javax/swing/text/PlainView.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/text/PlainView.java,v
retrieving revision 1.29
diff -u -r1.29 PlainView.java
--- javax/swing/text/PlainView.java 30 Oct 2005 22:03:50 -  1.29
+++ javax/swing/text/PlainView.java 3 Nov 2005 14:13:50 -
@@ -329,15 +329,20 @@
 int start = line.getStartOffset();
 int end = line.getEndOffset();
 try
-{
-  doc.getText(start, end - start, s);
-}
+  {
+doc.getText(start, end - start, s);
+
+// The end of line symbol (0xA), if being the last member in the
+// obtained text, should not be counted.
+if (s.last()==0xA  endstart)
+  s.count--;
+  }
 catch (BadLocationException ble)
-{
-  AssertionError ae = new AssertionError(Unexpected bad location);
-  ae.initCause(ble);
-  throw ae;
-}
+  {
+AssertionError ae = new AssertionError(Unexpected bad location);
+ae.initCause(ble);
+throw ae;
+  }
 
 int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, 
start);
 return Math.max (0, pos);
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Asking our experts on Swing.

2005-11-02 Thread Meskauskas Audrius
This evening I first tried my two player CORBA game. The CORBA works, 
the socket works, the layout and mouse events are ok - but, 
unfortunately, the supplementary chatting feature does not work just 
because it is not possible to put any text into the JTextField.


The JTextArea is cleared after sending the message by 
JTextField.setText(''). After I call this method in our Classpath, it 
refuses to accept any keyboard input, despite I see the cursor. 
Experimenting, I tried to call JTextField.setText(.) instead. In 
this case it was possible to enter the text inside the dotted area (the 
dots were shifting to the right as expected), but not possible to enter 
any additional text after clicking outside the dotted area (but still 
inside the text input field).


It seems that the mouse click right from the area that is already filled 
in with some text is ignored instead of placing the carret to the end of 
text and allowing the text input. Basically this means that the 
JTextField cannot perform one of the main its functions: being initially 
empty, become focused after the mouse click and then accept the input data.


Does anybody already knows about this problem or could suggest some 
workaround how to force the input work? On Sun's jre, the program runs 
without problems.


Audrius




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


[cp-patches] FYI: Stability fix for gnu/CORBA/SocketRepository

2005-10-31 Thread Meskauskas Audrius
This patch fixes some hanging problems that I observed when debugging my 
CORBA game example. These problems stayed unnoticed during tests because 
the game normally lasts much longer that it takes the test to complete.


2005-10-31  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/SocketRepository.java (not_reusable, gc): New methods.
(sockets): Use hashtable.
Index: gnu/CORBA/SocketRepository.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/SocketRepository.java,v
retrieving revision 1.3
diff -u -r1.3 SocketRepository.java
--- gnu/CORBA/SocketRepository.java 2 Sep 2005 15:53:05 -   1.3
+++ gnu/CORBA/SocketRepository.java 31 Oct 2005 10:33:20 -
@@ -40,8 +40,9 @@
 
 import java.net.Socket;
 import java.net.SocketException;
-
-import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * This class caches the opened sockets that are reused during the
@@ -55,10 +56,11 @@
   /**
* The socket map.
*/
-  private static HashMap sockets = new HashMap();
-
+  private static Hashtable sockets = new Hashtable();
+  
   /**
-   * Put a socket.
+   * Put a socket. This method also discards all not reusable sockets from
+   * the map.
*
* @param key as socket key.
*
@@ -67,6 +69,36 @@
   public static void put_socket(Object key, Socket s)
   {
 sockets.put(key, s);
+gc();
+  }
+  
+  /**
+   * Removes all non reusable sockets.
+   */
+  public static void gc()
+  {
+Iterator iter = sockets.entrySet().iterator();
+
+Map.Entry e;
+Socket sx;
+
+while (iter.hasNext())
+  {
+e = (Map.Entry) iter.next();
+sx = (Socket) e.getValue();
+
+if (not_reusable(sx))
+  iter.remove();
+  }
+  }
+  
+  /**
+   * Return true if the socket is no longer reusable.
+   */
+  static boolean not_reusable(Socket s)
+  {
+return (s.isClosed() || !s.isBound() || !s.isConnected() ||
+s.isInputShutdown() || s.isOutputShutdown());
   }
 
   /**
@@ -75,21 +107,26 @@
* @param key a socket key.
* 
* @return an opened socket for reuse, null if no such available or it is
-   * closed.
+   * closed, its input or output has been shutown or otherwise the socket
+   * is not reuseable.
*/
   public static Socket get_socket(Object key)
   {
+if (true)
+  return null;
+
 Socket s = (Socket) sockets.get(key);
 if (s == null)
   return null;
-else if (s.isClosed())
+
+// Ensure that the socket is fully reusable.
+else if (not_reusable(s))
   {
 sockets.remove(key);
 return null;
   }
 else
   {
-sockets.remove(key);
 try
   {
 // Set one minute time out that will be changed later.
@@ -99,6 +136,8 @@
   {
 s = null;
   }
+
+sockets.remove(key);
 return s;
   }
   }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: StatCVS report updated...

2005-10-31 Thread Meskauskas Audrius

55351 line of tests on the graphic user interface? Impressive!

David Gilbert wrote:

Another month has gone by, so I updated the StatCVS report for GNU 
Classpath:


http://www.object-refinery.com/classpath/statcvs/

Regards,

Dave





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


[cp-patches] FYI: Moving Classpath specific CORBA typecodes into the single package.

2005-10-28 Thread Meskauskas Audrius

This patch groups our CORBA typecodes into package gnu.CORBA.typecodes.

2005-10-28  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/typecodes/AliasTypeCode.java,
gnu/CORBA/typecodes/ArrayTypeCode.java,
gnu/CORBA/typecodes/FixedTypeCode.java,
gnu/CORBA/typecodes/GeneralTypeCode.java,
gnu/CORBA/typecodes/PrimitiveTypeCode.java,
gnu/CORBA/typecodes/RecordTypeCode.java,
gnu/CORBA/typecodes/RecursiveTypeCode.java,
gnu/CORBA/typecodes/StringTypeCode.java,
gnu/CORBA/typecodes/package.html: New files.

* gnu/CORBA/aliasTypeCode.java,
gnu/CORBA/primitiveArrayTypeCode.java,
gnu/CORBA/fixedTypeCode.java,
gnu/CORBA/generalTypeCode.java,
gnu/CORBA/primitiveTypeCode.java,
gnu/CORBA/recordTypeCode.java,
gnu/CORBA/recursiveTypeCode.java,
gnu/CORBA/stringTypeCode.java: Deleted.

* gnu/CORBA/CDR/cdrOutput.java,
gnu/CORBA/ObjectCreator.java,
gnu/CORBA/OctetHolder.java,
gnu/CORBA/Poa/LocalRequest.java,
gnu/CORBA/Poa/gnuServantObject.java,
gnu/CORBA/Restricted_ORB.java,
gnu/CORBA/TypeCodeHelper.java,
gnu/CORBA/WCharHolder.java,
gnu/CORBA/WStringHolder.java,
gnu/CORBA/gnuAny.java,
gnu/CORBA/typeNamer.java,
gnu/javax/rmi/CORBA/UtilDelegateImpl.java,
org/omg/CORBA/AnyHolder.java,
org/omg/CORBA/AnySeqHelper.java,
org/omg/CORBA/AnySeqHolder.java,
org/omg/CORBA/BooleanHolder.java,
org/omg/CORBA/BooleanSeqHelper.java,
org/omg/CORBA/BooleanSeqHolder.java,
org/omg/CORBA/ByteHolder.java,
org/omg/CORBA/CharHolder.java,
org/omg/CORBA/CharSeqHelper.java,
org/omg/CORBA/CharSeqHolder.java,
org/omg/CORBA/DefinitionKindHelper.java,
org/omg/CORBA/DoubleHolder.java,
org/omg/CORBA/DoubleSeqHelper.java,
org/omg/CORBA/DoubleSeqHolder.java,
org/omg/CORBA/FixedHolder.java,
org/omg/CORBA/FloatHolder.java,
org/omg/CORBA/FloatSeqHelper.java,
org/omg/CORBA/FloatSeqHolder.java,
org/omg/CORBA/IntHolder.java,
org/omg/CORBA/LongHolder.java,
org/omg/CORBA/LongLongSeqHelper.java,
org/omg/CORBA/LongLongSeqHolder.java,
org/omg/CORBA/LongSeqHelper.java,
org/omg/CORBA/LongSeqHolder.java,
org/omg/CORBA/NameValuePairHelper.java,
org/omg/CORBA/ORB.java,
org/omg/CORBA/ObjectHelper.java,
org/omg/CORBA/ObjectHolder.java,
org/omg/CORBA/OctetSeqHelper.java,
org/omg/CORBA/OctetSeqHolder.java,
org/omg/CORBA/PolicyErrorCodeHelper.java,
org/omg/CORBA/PrincipalHolder.java,
org/omg/CORBA/ShortHolder.java,
org/omg/CORBA/ShortSeqHelper.java,
org/omg/CORBA/ShortSeqHolder.java,
org/omg/CORBA/StringHolder.java,
org/omg/CORBA/StringSeqHelper.java,
org/omg/CORBA/StringSeqHolder.java,
org/omg/CORBA/TypeCodeHolder.java,
org/omg/CORBA/ULongLongSeqHelper.java,
org/omg/CORBA/ULongLongSeqHolder.java,
org/omg/CORBA/ULongSeqHelper.java,
org/omg/CORBA/ULongSeqHolder.java,
org/omg/CORBA/UShortSeqHelper.java,
org/omg/CORBA/UShortSeqHolder.java,
org/omg/CORBA/ValueBaseHelper.java,
org/omg/CORBA/WCharSeqHelper.java,
org/omg/CORBA/WCharSeqHolder.java,
org/omg/CORBA/WStringSeqHelper.java,
org/omg/CORBA/WStringSeqHolder.java,
org/omg/Messaging/SyncScopeHelper.java: References modified.



TypeCodes.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Renaming 9 classes in gnu.CORBA

2005-10-28 Thread Meskauskas Audrius
Due historical reasons some class names in CORBA implementation packages 
start with the lowercase letter. I plan gradually migrate to the names 
starting from uppercase, except perhaps classes with gnu prefix that 
reads much better being in lowercase and is also very abundant.


2005-10-28  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/universalHolder.java
gnu/CORBA/stubFinder.java
gnu/CORBA/typeNamer.java
gnu/CORBA/streamRequest.java
gnu/CORBA/streamReadyHolder.java
gnu/CORBA/binaryReply.java
gnu/CORBA/bufferedResponseHandler.java
gnu/CORBA/cdrEncapsCodec.java
gnu/CORBA/corbaArrayList.java: Removed.
* gnu/CORBA/CdrEncapsCodecImpl.java,
gnu/CORBA/CorbaList.java,
gnu/CORBA/GeneralHolder.java,
gnu/CORBA/RawReply.java,
gnu/CORBA/ResponseHandlerImpl.java,
gnu/CORBA/StreamBasedRequest.java,
gnu/CORBA/StreamHolder.java,
gnu/CORBA/StubLocator.java,
gnu/CORBA/TypeKindNamer.java: New files.
* gnu/CORBA/CDR/cdrInput.java,
gnu/CORBA/DynAn/abstractDynAny.java,
gnu/CORBA/DynAn/anyDivideable.java,
gnu/CORBA/DynAn/gnuDynAny.java,
gnu/CORBA/DynAn/gnuDynAnyFactory.java,
gnu/CORBA/Functional_ORB.java,
gnu/CORBA/IOR_Delegate.java,
gnu/CORBA/ObjectCreator.java,
gnu/CORBA/Poa/LocalDelegate.java,
gnu/CORBA/Poa/LocalRequest.java,
gnu/CORBA/Poa/gnuServantObject.java,
gnu/CORBA/Restricted_ORB.java,
gnu/CORBA/ServiceRequestAdapter.java,
gnu/CORBA/gnuAny.java,
gnu/CORBA/gnuCodecFactory.java,
gnu/CORBA/gnuContextList.java,
gnu/CORBA/gnuExceptionList.java,
gnu/CORBA/gnuNVList.java,
gnu/CORBA/gnuRequest.java,
gnu/CORBA/typecodes/RecordTypeCode.java:
References updated.


cRen1.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Renaming 4 classes in gnu.javax.rmi.CORBA

2005-10-28 Thread Meskauskas Audrius

2005-10-28  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/javax/rmi/CORBA/corbaObjectInput.java,
   gnu/javax/rmi/CORBA/corbaObjectOutput.java,
   gnu/javax/rmi/CORBA/dwoTester.java,
   gnu/javax/rmi/CORBA/gnuRmiUtil: Deleted.

   * gnu/javax/rmi/CORBA/CorbaInput.java,
   gnu/javax/rmi/CORBA/CorbaOutput.java,
   gnu/javax/rmi/CORBA/DefaultWriteObjectTester.java,
   gnu/javax/rmi/CORBA/RmiUtilities.java: New files.

   * gnu/javax/rmi/CORBA/UtilDelegateImpl.java,
   gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java:
   References updated.


cRen4.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Renaming files ing gnu/CORBA/CDR

2005-10-28 Thread Meskauskas Audrius

2005-10-28  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/CDR/abstractDataInputStream.java,
gnu/CORBA/CDR/abstractDataOutputStream.java,
gnu/CORBA/CDR/aligningInputStream.java,
gnu/CORBA/CDR/aligningOutputStream.java,
gnu/CORBA/CDR/cdrBufInput.java.java,
gnu/CORBA/CDR/cdrBufOutput.java
gnu/CORBA/CDR/cdrInput.java,
gnu/CORBA/CDR/cdrOutput.java,
gnu/CORBA/CDR/encapsulatedOutput.java,
gnu/CORBA/CDR/noHeaderInput.java: Removed.

* gnu/CORBA/CDR/HeadlessInput.java
gnu/CORBA/CDR/AbstractCdrInput.java
gnu/CORBA/CDR/AbstractCdrOutput.java
gnu/CORBA/CDR/AbstractDataInput.java
gnu/CORBA/CDR/AbstractDataOutput.java
gnu/CORBA/CDR/AligningInput.java
gnu/CORBA/CDR/AligningOutput.java
gnu/CORBA/CDR/BufferedCdrOutput.java
gnu/CORBA/CDR/BufferredCdrInput.java
gnu/CORBA/CDR/EncapsulationStream.java: New files.

* gnu/CORBA/CDR/ArrayValueHelper.java,
gnu/CORBA/CDR/BigEndianInputStream.java,
gnu/CORBA/CDR/BigEndianOutputStream.java,
gnu/CORBA/CDR/LittleEndianInputStream.java,
gnu/CORBA/CDR/LittleEndianOutputStream.java,
gnu/CORBA/CDR/UnknownExceptionCtxHandler.java,
gnu/CORBA/CDR/Vio.java,
gnu/CORBA/CdrEncapsCodecImpl.java,
gnu/CORBA/DynAn/gnuDynAny.java,
gnu/CORBA/GIOP/MessageHeader.java,
gnu/CORBA/GIOP/ReplyHeader.java,
gnu/CORBA/GIOP/RequestHeader.java,
gnu/CORBA/GIOP/ServiceContext.java,
gnu/CORBA/GIOP/cxCodeSet.java,
gnu/CORBA/GIOP/v1_0/ReplyHeader.java,
gnu/CORBA/GIOP/v1_0/RequestHeader.java,
gnu/CORBA/GIOP/v1_2/ReplyHeader.java,
gnu/CORBA/GIOP/v1_2/RequestHeader.java,
gnu/CORBA/GeneralHolder.java,
gnu/CORBA/IOR.java,
gnu/CORBA/Interceptor/gnuIcCurrent.java,
gnu/CORBA/IorDelegate.java,
gnu/CORBA/ObjectCreator.java,
gnu/CORBA/OrbFunctional.java,
gnu/CORBA/OrbRestricted.java,
gnu/CORBA/Poa/LocalDelegate.java,
gnu/CORBA/Poa/LocalRequest.java,
gnu/CORBA/Poa/gnuPOA.java,
gnu/CORBA/RawReply.java,
gnu/CORBA/ResponseHandlerImpl.java,
gnu/CORBA/ServiceRequestAdapter.java,
gnu/CORBA/StreamBasedRequest.java,
gnu/CORBA/gnuAny.java,
gnu/CORBA/gnuRequest.java,
gnu/CORBA/typecodes/GeneralTypeCode.java,
gnu/javax/rmi/CORBA/DefaultWriteObjectTester.java,
gnu/javax/rmi/CORBA/RmiUtilities.java,
gnu/javax/rmi/CORBA/StubDelegateImpl.java,
org/omg/IOP/TaggedProfileHelper.java:
References updated.



RenCDR.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Renaming classes in gnu/CORBA/DynAn

2005-10-28 Thread Meskauskas Audrius

2005-10-28  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/DynAn/ValueChangeListener.java
gnu/CORBA/DynAn/AbstractAny.java
gnu/CORBA/DynAn/RecordAny.java
gnu/CORBA/DynAn/DivideableAny.java
gnu/CORBA/DynAn/UndivideableAny.java: New files.

* gnu/CORBA/DynAn/abstractDynAny.java,
gnu/CORBA/DynAn/recordAny.java,
gnu/CORBA/DynAn/anyDivideable.java,
gnu/CORBA/DynAn/anyUndivideable.java,
gnu/CORBA/DynAn/valueChangedListener.java: Removed.

* gnu/CORBA/DynAn/gnuDynAny.java,
gnu/CORBA/DynAn/gnuDynArray.java,
gnu/CORBA/DynAn/gnuDynEnum.java,
gnu/CORBA/DynAn/gnuDynFixed.java,
gnu/CORBA/DynAn/gnuDynStruct.java,
gnu/CORBA/DynAn/gnuDynUnion.java,
gnu/CORBA/DynAn/gnuDynValue.java,
gnu/CORBA/DynAn/gnuDynValueBox.java:
References updated.


RenDynAn.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Renaming CORBA examples.

2005-10-28 Thread Meskauskas Audrius

2005-10-28  Audrius Meskauskas  [EMAIL PROTECTED]

* examples\gnu\classpath\examples\CORBA\SimpleCommunication\comServer.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\passThisHolder.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\returnThisHolder.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\_comTesterImplBase.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\_comTesterStub.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\comServant.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\comTester.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\node.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\nodeHelper.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\nodeHolder.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\ourUserException.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\ourUserExceptionHelper.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\passThis.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\passThisHelper.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\returnThis.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\returnThisHelper.java: 
Deleted.

* examples\gnu\classpath\examples\CORBA\SimpleCommunication\comServer.java,
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\DirectTest.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\RequestTest.java:References 
updated.
* 
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\StructureToPassHolder.java

examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\_DemoTesterImplBase.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\_DemoTesterStub.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\DemoServant.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\DemoTester.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\TreeNode.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\TreeNodeHelper.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\TreeNodeHolder.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\WeThrowThisException.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\WeThrowThisExceptionHelper.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\StructureToPassHelper.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\StructureToReturn.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\StructureToPass.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\StructureToReturnHelper.java
examples\gnu\classpath\examples\CORBA\SimpleCommunication\communication\StructureToReturnHolder.java: 
New files.




Samples.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: Removing gnu.CORBA.ExceptionCreator

2005-10-27 Thread Meskauskas Audrius

This file is no longer referenced and can be deleted.

2005-10-27  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/ExceptionCreator.java: Deleted.



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


[cp-patches] FYI: Refreshing the bug reporting URL in BUGS.

2005-10-27 Thread Meskauskas Audrius

All bugs have moved to Bugzilla ages ago.

2005-10-27  Audrius Meskauskas  [EMAIL PROTECTED]

   * BUGS: URL refreshed.
Index: BUGS
===
RCS file: /cvsroot/classpath/classpath/BUGS,v
retrieving revision 1.5
diff -u -r1.5 BUGS
--- BUGS21 Dec 2002 05:39:06 -  1.5
+++ BUGS27 Oct 2005 07:42:56 -
@@ -2,4 +2,4 @@
 early to start listing bugs in a file like this one!
 
 Report bugs to classpath@gnu.org or much better via Savannah at this
-URL: http://savannah.gnu.org/bugs/?group=classpath
+URL: http://www.gnu.org/software/classpath/bugs.html
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: PortableInterceptor ObjectId API compatibility fix.

2005-10-27 Thread Meskauskas Audrius

2005-10-27  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/PortableInterceptor/ObjectIdHelper.java:
Assuming ObjectId as alias of byte[], not alias  of String.
Index: org/omg/PortableInterceptor/ObjectIdHelper.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/ObjectIdHelper.java,v
retrieving revision 1.1
diff -u -r1.1 ObjectIdHelper.java
--- org/omg/PortableInterceptor/ObjectIdHelper.java 26 Oct 2005 09:33:20 
-  1.1
+++ org/omg/PortableInterceptor/ObjectIdHelper.java 27 Oct 2005 13:49:34 
-
@@ -42,14 +42,15 @@
 
 import org.omg.CORBA.Any;
 import org.omg.CORBA.ORB;
+import org.omg.CORBA.OctetSeqHelper;
+import org.omg.CORBA.OctetSeqHolder;
 import org.omg.CORBA.TypeCode;
 import org.omg.CORBA.portable.InputStream;
 import org.omg.CORBA.portable.OutputStream;
 
 /**
- * The Object Id is defined in OMG specification just as a narrow (not wide)
- * string. As such, the Object Id needs no helper, but one is included in
- * the API anyway.
+ * The Object Id of this package is defined in OMG specification as a byte 
array.
+ * As such, the Object Id needs no helper, but one is included in the API 
anyway.
  * 
  * @since 1.5 
  *
@@ -58,33 +59,34 @@
 public abstract class ObjectIdHelper
 {
   /**
-   * Insert the Object Id into Any (uses [EMAIL PROTECTED] Any.insert_string}).
+   * Insert the Object Id into Any.
*
* @param a the Any to insert into.
* @param that the string to insert.
*/
-  public static void insert(Any a, String that)
+  public static void insert(Any a, byte[] that)
   {
-a.insert_string(that);
+a.insert_Streamable(new OctetSeqHolder(that));
+a.type(type());
   }
 
   /**
-   * Extract the Object Id from Any ((uses [EMAIL PROTECTED] 
Any.extract_string}).
-   *
+   * Extract the Object Id from Any.
+   * 
* @param a the Any to extract from.
*/
-  public static String extract(Any a)
+  public static byte[] extract(Any a)
   {
-return a.extract_string();
+return ((OctetSeqHolder) a.extract_Streamable()).value;
   }
 
   /**
-   * Return an alias typecode.
+   * Return an alias typecode (an alias of the octet sequence).
*/
   public static TypeCode type()
   {
 ORB orb = Restricted_ORB.Singleton;
-return orb.create_alias_tc(id(), ObjectId, orb.create_string_tc(0));
+return orb.create_alias_tc(id(), ObjectId, OctetSeqHelper.type());
   }
 
   /**
@@ -97,23 +99,23 @@
   }
 
   /**
-   * Calls [EMAIL PROTECTED] InputStream#read_string()}.
+   * Read the Object Id as a byte array.
*
* @param input the stream to read from.
*/
-  public static String read(InputStream input)
+  public static byte[] read(InputStream input)
   {
-return input.read_string();
+return OctetSeqHelper.read(input);
   }
 
   /**
-   * Calls [EMAIL PROTECTED] OutputStream#write_string()}.
+   * Write the Object Id as a byte array.
*
* @param output the stream to write into.
-   * @param value the string (Object Id) value to write.
+   * @param value the Object Id value to write.
*/
-  public static void write(OutputStream output, String value)
+  public static void write(OutputStream output, byte[] value)
   {
-output.write_string(value);
+OctetSeqHelper.write(output, value);
   }
 }
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: New class - WrappedPlainView

2005-10-26 Thread Meskauskas Audrius
Oh, you cannot imagine how I am happy to see somebody working on that 
disasterous package!


Anthony Balkissoon wrote:

I added the class javax.swing.text.WrappedPlainView.  





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


[cp-patches] FYI: More 1.5 CORBA classes

2005-10-26 Thread Meskauskas Audrius

2005-10-26  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/PortableInterceptor/AdapterManagerIdHelper.java,
org/omg/PortableInterceptor/AdapterNameHelper.java,
org/omg/PortableInterceptor/AdapterStateHelper.java,
org/omg/PortableInterceptor/ORBIdHelper.java,
org/omg/PortableInterceptor/ObjectIdHelper.java,
org/omg/PortableInterceptor/ServerIdHelper.java: New files.
* org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java
(type): Fixed typo in typecode name.

? org/omg/PortableInterceptor/AdapterManagerIdHelper.java
? org/omg/PortableInterceptor/AdapterNameHelper.java
? org/omg/PortableInterceptor/AdapterStateHelper.java
? org/omg/PortableInterceptor/ORBIdHelper.java
? org/omg/PortableInterceptor/ObjectIdHelper.java
? org/omg/PortableInterceptor/ServerIdHelper.java
Index: org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java,v
retrieving revision 1.2
diff -u -r1.2 ObjectIdHelper.java
--- org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java  2 Jul 
2005 20:33:01 -   1.2
+++ org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java  26 Oct 
2005 08:20:34 -
@@ -82,7 +82,7 @@
   public static TypeCode type()
   {
 ORB orb = Restricted_ORB.Singleton;
-return orb.create_alias_tc(id(), Object Id, orb.create_string_tc(0));
+return orb.create_alias_tc(id(), ObjectId, orb.create_string_tc(0));
   }
 
   /**
@@ -97,7 +97,7 @@
   /**
* Calls [EMAIL PROTECTED] InputStream#read_string()}.
*
-   * @param instream the stream to read from.
+   * @param input the stream to read from.
*/
   public static String read(InputStream input)
   {
@@ -107,7 +107,7 @@
   /**
* Calls [EMAIL PROTECTED] OutputStream#write_string()}.
*
-   * @param ostream the stream to write into.
+   * @param output the stream to write into.
* @param value the string (Object Id) value to write.
*/
   public static void write(OutputStream output, String value)


PortableInterceptor.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI:ObjectReferenceFactory with friends (1.5 CORBA)

2005-10-26 Thread Meskauskas Audrius

2005-10-26  Audrius Meskauskas  [EMAIL PROTECTED]

   * org/omg/PortableInterceptor/ObjectReferenceFactory.java,
   org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java,
   org/omg/PortableInterceptor/ObjectReferenceFactoryHolder.java,
   org/omg/PortableInterceptor/ObjectReferenceFactoryOperations.java:
   New files.



ObjectReferenceFactory.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: 0.19 generics branch release? was Re: 0.19 release meeting

2005-10-26 Thread Meskauskas Audrius
Can we just run the same Mauve tests for it? Generics branch includes 
new features, but the old code should still be supported. If there are 
no regressions, I think we surely could release.


Audrius




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


[cp-patches] FYI: Renaming gnuSocketFactory into SocketFactory.

2005-10-25 Thread Meskauskas Audrius
Roman suggested that the gnuSocketFactory in the public interfaces 
should be better called 'SocketFactory' instead. It is in the interface 
that I plan to make public and never modify after it was once released, 
so such things are probably important.  As Classpath is not yet 
released, I suggest to rename that class now.


2005-10-25  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/interfaces/SocketFactory.java: New file.
* gnu/CORBA/interfaces/gnuSocketFactory.java: Deleted.
* gnu/CORBA/DefaultSocketFactory.java,
gnu/CORBA/Functional_ORB.java,
org/omg/CORBA/ORB.java: Replacing gnuSocketFactory into SocketFactory.

? gnu/CORBA/interfaces/SocketFactory.java
Index: gnu/CORBA/DefaultSocketFactory.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/DefaultSocketFactory.java,v
retrieving revision 1.1
diff -u -r1.1 DefaultSocketFactory.java
--- gnu/CORBA/DefaultSocketFactory.java 21 Oct 2005 16:15:32 -  1.1
+++ gnu/CORBA/DefaultSocketFactory.java 25 Oct 2005 12:27:08 -
@@ -38,7 +38,7 @@
 
 package gnu.CORBA;
 
-import gnu.CORBA.interfaces.gnuSocketFactory;
+import gnu.CORBA.interfaces.SocketFactory;
 
 import java.io.IOException;
 import java.net.ServerSocket;
@@ -51,7 +51,7 @@
  * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
  */
 public class DefaultSocketFactory
-  implements gnuSocketFactory
+  implements SocketFactory
 {
   /**
* It is enough to have one instance of this class for all ORBs.
Index: gnu/CORBA/Functional_ORB.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Functional_ORB.java,v
retrieving revision 1.22
diff -u -r1.22 Functional_ORB.java
--- gnu/CORBA/Functional_ORB.java   21 Oct 2005 16:15:32 -  1.22
+++ gnu/CORBA/Functional_ORB.java   25 Oct 2005 12:27:08 -
@@ -49,7 +49,7 @@
 import gnu.CORBA.NamingService.NameParser;
 import gnu.CORBA.NamingService.NamingServiceTransient;
 import gnu.CORBA.Poa.gnuForwardRequest;
-import gnu.CORBA.interfaces.gnuSocketFactory;
+import gnu.CORBA.interfaces.SocketFactory;
 
 import org.omg.CORBA.BAD_OPERATION;
 import org.omg.CORBA.BAD_PARAM;
@@ -450,7 +450,7 @@
   /**
* The producer of the client and server sockets for this ORB.
*/
-  public gnuSocketFactory socketFactory = DefaultSocketFactory.Singleton;
+  public SocketFactory socketFactory = DefaultSocketFactory.Singleton;
 
   /**
* Create the instance of the Functional ORB.
@@ -1623,14 +1623,14 @@
 );
   }
 
-if (props.containsKey(gnuSocketFactory.PROPERTY))
+if (props.containsKey(SocketFactory.PROPERTY))
   {
 String factory = null;
 try
   {
-factory = props.getProperty(gnuSocketFactory.PROPERTY);
+factory = props.getProperty(SocketFactory.PROPERTY);
 if (factory!=null)
-  socketFactory = (gnuSocketFactory) 
+  socketFactory = (SocketFactory) 
 ObjectCreator.forName(factory).newInstance();
   }
 catch (Exception ex)
Index: org/omg/CORBA/ORB.java
===
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/ORB.java,v
retrieving revision 1.20
diff -u -r1.20 ORB.java
--- org/omg/CORBA/ORB.java  21 Oct 2005 16:15:32 -  1.20
+++ org/omg/CORBA/ORB.java  25 Oct 2005 12:27:08 -
@@ -113,7 +113,7 @@
  * property com.sun.CORBA.connection.ORBSocketFactoryClass. To have multiple
  * types of sockets, instantiate several ORB's with this property each time
  * set to the different value. 
- * The factory must implement gnu.CORBA.interfaces.gnuSocketFactory.
+ * The factory must implement gnu.CORBA.interfaces.SocketFactory.
  * /td
  * /tr
  * /table 
/* SocketFactory.java --
   Copyright (C) 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you

[cp-patches] FYI: CORBA example fix.

2005-10-25 Thread Meskauskas Audrius
Eclipse refuses to start the CORBA naming service example because the 
parameters of the main method are declared as final

This patch makes them no longer final.

2005-10-25  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/classpath/examples/CORBA/NamingService/Demo.java (main):
Make arguments not final.
Index: examples/gnu/classpath/examples/CORBA/NamingService/Demo.java
===
RCS file: 
/cvsroot/classpath/classpath/examples/gnu/classpath/examples/CORBA/NamingService/Demo.java,v
retrieving revision 1.2
diff -u -r1.2 Demo.java
--- examples/gnu/classpath/examples/CORBA/NamingService/Demo.java   2 Jul 
2005 20:32:08 -   1.2
+++ examples/gnu/classpath/examples/CORBA/NamingService/Demo.java   25 Oct 
2005 13:03:14 -
@@ -73,7 +73,7 @@
  */
 public class Demo
 {
-  public static void main(final String[] args)
+  public static void main(String[] an_args)
   {
 // We create the following naming graph:
 // ROOT CONTEXT
@@ -90,6 +90,8 @@
 System.out.println(Starting the GNU Classpath  +
built-in transient naming service
   );
+
+final String[] args = an_args;
 
 new Thread()
   {
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


RMI-IIOP and CORBA needs a popular example.

2005-10-25 Thread Meskauskas Audrius

Unfortunately I cannot test it, because I have absolutely no clue about CORBA 
:-(
Cheers.


I seems that GNU Classpath would highly benefit from some popular CORBA/RMI example, something like a simplified mutliplayer game or a simplified booking system without browser. It is important is not to over try beyond current capabilities of our Swing. 

All numerous CORBA and RMI-IIOP applications I know are parts of the large specialized systems and cannot serve as examples. Does anybody in the mailing list knows such application or could suggest an idea? 


Regards

Audrius.





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


[cp-patches] FYI: Minor RMI-IIOP bug fix.

2005-10-23 Thread Meskauskas Audrius
The readValue(...) was trying to read fields of the RMI Stub  that may 
follow the

IOR reference. The stubs, generated by rmic, have no any fields, but the
bug reveals itself with the user-modified stubs.

2005-10-23  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/javax/rmi/CORBA/gnuRmiUtil.java (readValue):
   Do not read fields of the ObjectImpl.

Index: gnu/javax/rmi/CORBA/gnuRmiUtil.java
===
RCS file: /cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/gnuRmiUtil.java,v
retrieving revision 1.3
diff -u -r1.3 gnuRmiUtil.java
--- gnu/javax/rmi/CORBA/gnuRmiUtil.java 4 Oct 2005 17:58:15 -   1.3
+++ gnu/javax/rmi/CORBA/gnuRmiUtil.java 23 Oct 2005 10:09:40 -
@@ -757,6 +757,13 @@
 
 if (object == null)
   object = instantiate(offset, clz, g);
+
+// The sentence below prevents attempt to read the internal fields of the
+// ObjectImpl (or RMI Stub) that might follow the object definition.
+// Sun's jre 1.5 does not write this information. The stubs, generated
+// by rmic, does not contain such fields.
+if (object instanceof ObjectImpl)
+  return object;
 
 if (object instanceof Externalizable)
   {
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: gnu/CORBA/Interceptor/Registrator.java (m_prefix): Made static.

2005-10-23 Thread Meskauskas Audrius

2005-10-23  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/CORBA/Interceptor/Registrator.java (m_prefix): Made static.
Index: gnu/CORBA/Interceptor/Registrator.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Interceptor/Registrator.java,v
retrieving revision 1.5
diff -u -r1.5 Registrator.java
--- gnu/CORBA/Interceptor/Registrator.java  13 Oct 2005 20:58:54 -  
1.5
+++ gnu/CORBA/Interceptor/Registrator.java  23 Oct 2005 10:48:56 -
@@ -88,7 +88,7 @@
   /**
* The agreed properties prefix.
*/
-  public final String m_prefix =
+  public static final String m_prefix =
 org.omg.PortableInterceptor.ORBInitializerClass.;
 
   /**
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] RFC: java.io.File.createTempFile

2005-10-23 Thread Meskauskas Audrius
This path should fix the bug #22972 (createTempFile returns the same 
value for parallel threads).


There is a Mauve test (createFile) now that demonstrates the problem. 
The first idea was just to synchronize the method. However even being 
synchronized, it was failing if the previously returned file was already 
deleted from the file system. Specification states that the same name 
should not be reused.


To solve the problem, I introduced the counter for the temporary files, 
created during the current millisecond. By including the counter value 
into the name of the temporary file, it is possible to create multiple 
files during the same millisecond without any need to wait. We still 
need to synchronize because of the counter field. The counter is dropped 
to zero if the new millisecond comes. To make file names not longer as 
before, I switched into hexadecimal system.


Unfortunately, the DOS name version seems not providing enough space 
for the counter. However, as much as I was able to test, synchronization 
also improves the work of this part, and the same file is not returned 
at least while it still exists.


The great thing would be to add the process Id to the name also. Now the 
same name can be still grabbed by the two (and especially more) virtual 
machines that are running together. But it seems that this would require 
native coding.


java.io is one of the central packages, so I post this as RFC first. For 
me, it works. Under no contradictions, I would apply it after a few days.


2005-10-23  Audrius Meskauskas  [EMAIL PROTECTED]

* java/io/File (createTempFile): Rewritten.


Index: java/io/File.java
===
RCS file: /cvsroot/classpath/classpath/java/io/File.java,v
retrieving revision 1.57
diff -u -r1.57 File.java
--- java/io/File.java   2 Jul 2005 20:32:37 -   1.57
+++ java/io/File.java   23 Oct 2005 17:02:30 -
@@ -100,6 +100,17 @@
* may be an absolute or relative path name.
*/
   private String path;
+  
+  
+  /**
+   * The time (millisecond), when the last temporary file was created.
+   */
+  private static long last_tmp;
+  
+  /**
+   * The number of files, created during the current millisecond.
+   */
+  private static int n_created;  
 
   /**
* This method tests whether or not the current thread is allowed to
@@ -1059,7 +1070,7 @@
*
* @since 1.2
*/
-  public static File createTempFile(String prefix, String suffix,
+  public static synchronized File createTempFile(String prefix, String suffix,
File directory)
 throws IOException
   {
@@ -1091,10 +1102,23 @@
 // Now identify a file name and make sure it doesn't exist.
 File file;
 if (!VMFile.IS_DOS_8_3)
-  {  
+  { 
 do
   {
-String filename = prefix + System.currentTimeMillis() + suffix;
+long now = System.currentTimeMillis();
+if (now  last_tmp)
+  {
+// The last temporary file was created more than 1 ms ago.
+last_tmp = now;
+n_created = 0;
+  }
+else
+  n_created++;
+
+String name = Long.toHexString(now);
+if (n_created  0)
+  name += '_'+Integer.toHexString(n_created);
+String filename = prefix + name + suffix;
 file = new File(directory, filename);
   }
 while (VMFile.exists(file.path));
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: New 1.5 RMI CORBA class.

2005-10-22 Thread Meskauskas Audrius
This adds the new jdk 1.5 class to the javax.rmi.CORBA package. If I 
understand the resend talks correctly, we commit 1.5 classes to the main 
branch.


The new class is an interface. For implementation, two simple methods 
are added to ValueHandlerDelegateImpl.


2005-10-22  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/rmi/CORBA/ValueHandlerMultiFormat.java: New interface.
* gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java
(getMaximumStreamFormatVersion, writeValue): New methods.
/* ValueHandlerMultiFormat.java --
   Copyright (C) 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
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.rmi.CORBA;

import org.omg.CORBA.portable.OutputStream;

import java.io.Serializable;

/**
 * This interface extends the previous ValueHandler, supporting various stream
 * format versions. The [EMAIL PROTECTED] ValueHandler} can be casted into this interface
 * to access additional features.
 * 
 * @since 1.5
 * 
 * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
 */
public interface ValueHandlerMultiFormat
  extends ValueHandler
{
  /**
   * Get the maximal supported version for the value types, supported by
   * this value handler. The versions are integer numbers, the currently valid
   * values being 1 and 2.
   * 
   * These two versions differ in how the additional data, stored by the
   * writeObject method, are encoded.
   * ul
   * li For version 1 (GNU Classpath default), that data (if present) are
   * written as is. /li
   * liFor version 2, this data fragment is enclosed within a CDR custom
   * valuetype with no codebase and repository Id RMI:org.omg.custom.class
   * where class is the fully-qualified name of the class whose writeObject
   * method is being invoked. If the object does not write any data via
   * writeObject method, the null valuetype (0x0) must be written./li
   * /ul
   * As the version number is part of the value type record, there is no need
   * to the format control during the reading.
   * 
   * @return the maximal supported version.
   */
  byte getMaximumStreamFormatVersion();

  /**
   * Write the value type to the output stream using the given format version.
   * The older method [EMAIL PROTECTED] ValueHandler#writeValue} always uses the version 1.
   * 
   * @param output the stream, where the value should be written, must implement
   * [EMAIL PROTECTED] ValueOutputStream}.
   * @param value the value that should be written.
   * @param version the version of the format that must be used to write the
   * value.
   * 
   * @throws BAD_PARAM if the version number is less than 1 or greater than the
   * maximal supported version.
   */
  void writeValue(OutputStream output, Serializable value, byte version);
}
? javax/rmi/CORBA/ValueHandlerMultiFormat.java
Index: gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java
===
RCS file: 
/cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java,v
retrieving revision 1.2
diff -u -r1.2 ValueHandlerDelegateImpl.java
--- gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java   3 Oct 2005 14:37:05 
-   1.2
+++ gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java   22 Oct 2005 17:25:48 
-
@@ -40,7 +40,9 @@
 
 import gnu.CORBA.CDR.gnuRuntime;
 
+import org.omg.CORBA.BAD_PARAM;
 import org.omg.CORBA.CustomMarshal;
+import 

[cp-patches] FYI: Several 1.5 CORBA exceptions.

2005-10-22 Thread Meskauskas Audrius
cid:part1.05000405.09020508@bluewin.ch2005-10-22  Audrius Meskauskas  
[EMAIL PROTECTED]


   * org/omg/CORBA/ACTIVITY_COMPLETED.java,
   org/omg/CORBA/ACTIVITY_REQUIRED.java,
   org/omg/CORBA/BAD_QOS.java,
   org/omg/CORBA/CODESET_INCOMPATIBLE.java,
   org/omg/CORBA/INVALID_ACTIVITY.java,
   org/omg/CORBA/REBIND.java,
   org/omg/CORBA/TIMEOUT.java,
   org/omg/CORBA/TRANSACTION_MODE.java,
   org/omg/CORBA/TRANSACTION_UNAVAILABLE.java: New exceptions.



c15exc.tar.gz
Description: GNU Zip compressed data
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: New GNU Classpath developers Nicolas and Christian

2005-10-22 Thread Meskauskas Audrius
I have looked at several .pdf's on your page and was impressed.  Do not 
forget to add to doc/www.gnu.org/stories.wml (success stories), 
probably under science.


Regards

Audrius.





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


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

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


2005-10-20  Audrius Meskauskas  [EMAIL PROTECTED]

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

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


Re: [cp-patches]: Patch: UIDefaults fix

2005-10-16 Thread Meskauskas Audrius
These two loaders I believe should be the same by default, but there is 
a method in Thread to set the thread context class loader directly. This 
can help as workaround when the user classes must be loaded from some 
other place. For instance, when we run Mauve test, the system class 
loader = default context class loader = loader, used to load the 
application is the loader who started the Ant. It will not load any test 
class by name because these are loaded by the custom Ant class loader.


To get the test work, I obtain the class loader of the testlet and 
temporary set it as a context class loader for the thread that enters 
the Testlet.test. Then Thread.getConextClassLoader() in the testlet 
returns the correct loader, even if called from another thread, 
constructed inside the Testlet.test.


I would suggest to think twice before using Class.forName in the core 
class. Class.forName there means use the loader of the current class = 
use system class loader. And the system class loader only knowns about 
GNU Classpath classes and about nothing else.


Sun's CORBA somehow manages to find classes that are not visible by both 
system and context class loaders, but are present in the execution 
stack. I was only able to implement the same with the help of 
VMStackWalker, as it was suggested by Jeroen.


Tom Tromey wrote:


Audrius == Meskauskas Audrius [EMAIL PROTECTED] writes:
   



Audrius getSystemClassLoader returns the different loader that
Audrius has loaded the application, same as the default
Audrius Thread.getConextClassLoader() that I would use in this case.

We have a few PRs in this area.  What we need are test cases to
determine whether the system or context class loader ought to be used.

Tom


 





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


[cp-patches] FYI: gnu.CORBA.ListenerPort property.

2005-10-16 Thread Meskauskas Audrius
Various firewalls does not allow opening multiple randomly selected 
ports, as

the default CORBA implementation used to do. The firewall must be configured
to allow CORBA to work on one fixed port or (for better performance) on a
small fixed range of ports. This does not restrict the maximal number of the
connected objects as the objects can share the same port.

As far as I currently know, there is no OMG standard property for this, but
there are proprietary properties like com.ibm.CORBA.ListenerPort
or com.sun.CORBA.POA.ORBPersistentServerPort. Lack of this feature
may prevent adaptation of java programs that needs them, so I suggest to
introduce the analogical  gnu.CORBA.ListenerPort property. The value of 
this
property is a single port or range of ports, boundary values (inclusive) 
being

separated by dash (for instance,  1245-1250).

2005-10-17  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/Focused_ORB.java: New file.
* gnu/CORBA/Functional_ORB.java,
org/omg/CORBA/ORB.java: Adapted to support the new property.

? gnu/CORBA/Focused_ORB.java
Index: gnu/CORBA/Functional_ORB.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Functional_ORB.java,v
retrieving revision 1.20
diff -u -r1.20 Functional_ORB.java
--- gnu/CORBA/Functional_ORB.java   5 Oct 2005 16:25:42 -   1.20
+++ gnu/CORBA/Functional_ORB.java   16 Oct 2005 17:37:14 -
@@ -103,12 +103,13 @@
* may listen on multiple ports and process the requests in separate threads.
* Normally the server takes one port per object being served.
*/
-  class portServer extends Thread
+  protected class portServer
+extends Thread
   {
 /**
  * The number of the currently running parallel threads.
  */
-int running_threads; 
+int running_threads;
 
 /**
  * The port on that this portServer is listening for requests.
@@ -132,27 +133,26 @@
 {
   s_port = _port;
   setDaemon(true);
-}
-
-/**
- * Enter the serving loop (get request/process it). All portServer normally
- * terminate thy threads when the Functional_ORB.running is set to false.
- */
-public void run()
-{
   try
 {
   service = new ServerSocket(s_port);
 }
   catch (IOException ex)
 {
-  BAD_OPERATION bad =
-new BAD_OPERATION(Unable to open the server socket at +s_port);
+  BAD_OPERATION bad = new BAD_OPERATION(
+Unable to open the server socket at  + s_port);
   bad.minor = Minor.Socket;
   bad.initCause(ex);
   throw bad;
 }
+}
 
+/**
+ * Enter the serving loop (get request/process it). All portServer normally
+ * terminate thy threads when the Functional_ORB.running is set to false.
+ */
+public void run()
+{
   while (running)
 {
   try
@@ -183,10 +183,11 @@
 
 /**
  * Perform a single serving step.
- *
+ * 
  * @throws java.lang.Exception
  */
-void tick() throws Exception
+void tick()
+  throws Exception
 {
   serve(this, service);
 }
@@ -222,7 +223,7 @@
* serving multiple requests (probably to the different objects) on the same
* thread.
*/
-  class sharedPortServer extends portServer
+  protected class sharedPortServer extends portServer
   {
 /**
  * Create a new portServer, serving on specific port.
@@ -395,7 +396,7 @@
   /**
* The currently active portServers.
*/
-  private ArrayList portServers = new ArrayList();
+  protected ArrayList portServers = new ArrayList();
 
   /**
* The host, on that the name service is expected to be running.
@@ -964,7 +965,7 @@
   
   /**
* Start the server in a new thread, if not already running. This method is
-   * used to ensure that the objects being transfered will be served fro the 
+   * used to ensure that the objects being transfered will be served from the 
* remote side, if required. If the ORB is started using this method, it
* starts as a daemon thread.
*/
@@ -1233,7 +1234,7 @@
* @throws BAD_PARAM if the object does not implement the
* [EMAIL PROTECTED] InvokeHandler}).
*/
-  private void prepareObject(org.omg.CORBA.Object object, IOR ior)
+  protected void prepareObject(org.omg.CORBA.Object object, IOR ior)
 throws BAD_PARAM
   {
 /*
@@ -1587,8 +1588,12 @@
 return;
   }
   }
-
-  private void useProperties(Properties props)
+  
+  /**
+   * Set the ORB parameters from the properties that were accumulated
+   * from several locations.
+   */
+  protected void useProperties(Properties props)
   {
 if (props != null)
   {
Index: org/omg/CORBA/ORB.java
===
RCS file: /cvsroot/classpath/classpath/org/omg/CORBA/ORB.java,v
retrieving revision 1.18
diff -u -r1.18 ORB.java
--- org/omg/CORBA/ORB.java  13 Oct 2005 20:58:54 - 

[cp-patches] FYI: Completing DynamicImplementation

2005-10-15 Thread Meskauskas Audrius
DynamicImplementation must be concrete, not abstract. This patch 
implements the previously abstract method invoke and makes the whole 
class no longer abstract. As a side effect, it was required to 
implements Simple_delegate.request that was previously never used.


2005-10-15  Audrius Meskauskas  [EMAIL PROTECTED]

   * org/omg/CORBA/DynamicImplementation.java: Made concrete.
   (invoke): Implemented.
   gnu/CORBA/Simple_delegate.java (request): Implemented.
Index: gnu/CORBA/Simple_delegate.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Simple_delegate.java,v
retrieving revision 1.5
diff -u -r1.5 Simple_delegate.java
--- gnu/CORBA/Simple_delegate.java  2 Oct 2005 19:58:00 -   1.5
+++ gnu/CORBA/Simple_delegate.java  15 Oct 2005 17:49:30 -
@@ -266,12 +266,19 @@
   }
 
   /**
-   * This should never be called this type delegate.
-   *
-   * @throws InternalError, always.
+   * This method assumes that the target is local and connected to the ORB.
*/
   public Request request(org.omg.CORBA.Object target, String operation)
   {
-throw new InternalError();
+if (orb instanceof Functional_ORB)
+  {
+((Functional_ORB) orb).ensureRunning();
+  }
+gnuRequest g = new gnuRequest();
+g.setORB(orb);
+g.setOperation(operation);
+g.setIor(ior);
+g.m_target = target;
+return g;
   }
 }
Index: org/omg/CORBA/DynamicImplementation.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/CORBA/DynamicImplementation.java,v
retrieving revision 1.2
diff -u -r1.2 DynamicImplementation.java
--- org/omg/CORBA/DynamicImplementation.java2 Jul 2005 20:32:56 -   
1.2
+++ org/omg/CORBA/DynamicImplementation.java15 Oct 2005 17:32:38 -
@@ -38,7 +38,12 @@
 
 package org.omg.CORBA;
 
+import gnu.CORBA.Unexpected;
+import gnu.CORBA.gnuAny;
+import gnu.CORBA.gnuNVList;
+
 import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.CORBA.portable.OutputStream;
 
 /**
  * This class was probably originally thinked as a base of all CORBA
@@ -51,18 +56,110 @@
  *
  * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
  */
-public abstract class DynamicImplementation
+public class DynamicImplementation
   extends ObjectImpl
 {
   /**
-   * Invoke the method of the CORBA object.
-   *
+   * Invoke the method of the CORBA object. After converting the parameters,
+   * this method delegates call to the [EMAIL PROTECTED] ObjectImpl#invoke}.
+   * 
* @deprecated since 1.4.
-   *
-   * @param request the container for both passing and returing the
-   * parameters, also contains the method name and thrown exceptions.
+   * 
+   * @param request the container for both passing and returing the parameters,
+   * also contains the method name and thrown exceptions.
*/
-  public abstract void invoke(ServerRequest request);
+  public void invoke(ServerRequest request)
+  {
+Request r = _request(request.operation());
+
+// Copy the parameters.
+NVList args = new gnuNVList();
+request.arguments(args);
+NamedValue v;
+int i = 0;
+
+try
+  {
+// Set the arguments.
+for (i = 0; i  args.count(); i++)
+  {
+v = args.item(i);
+Any n;
+OutputStream out;
+
+switch (v.flags())
+  {
+case ARG_IN.value:
+  out = v.value().create_output_stream();
+  v.value().write_value(out);
+  n = r.add_named_in_arg(v.name());
+  n.read_value(out.create_input_stream(), v.value().type());   
   
+  break;
+case ARG_INOUT.value:
+  out = v.value().create_output_stream();
+  v.value().write_value(out);
+  n = r.add_named_inout_arg(v.name());
+  n.read_value(out.create_input_stream(), v.value().type());   
   
+  break;
+case ARG_OUT.value:
+  r.add_named_out_arg(v.name());
+  break;
+
+default:
+  throw new InternalError(Invalid flags  + v.flags());
+  }
+  }
+  }
+catch (Bounds b)
+  {
+throw new Unexpected(args.count() + [ + i + ], b);
+  }
+
+// Set context.
+r.ctx(request.ctx());
+
+// Set the return type (expects that the ServerRequest will initialise
+// the passed Any.
+
+gnuAny g = new gnuAny();
+request.result(g);
+r.set_return_type(g.type());
+
+// Invoke the method.
+r.invoke();
+
+// Transfer the returned values.
+NVList r_args = r.arguments();
+
+try
+  {
+// API states that the ServerRequest.arguments must be called only
+// once. Hence we assume we can just modify the previously returned
+// value 

[cp-patches] FYI: PolicyErrorCodeHelper

2005-10-14 Thread Meskauskas Audrius

2005-10-14  Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/CORBA/PolicyErrorCodeHelper.java: New class.
/* PolicyErrorCodeHelper.java --
Copyright (C) 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
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 org.omg.CORBA;

import gnu.CORBA.primitiveTypeCode;
import gnu.CORBA.recordTypeCode;

import org.omg.CORBA.Any;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;

/**
 * A helper operations for the policy error code as an alias of
 * codeshort/code.
 * 
 * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
 */
public abstract class PolicyErrorCodeHelper

{

  /**
   * Delegates call to [EMAIL PROTECTED] Any.extract_short()}.
   */
  public static short extract(Any a)
  {
return a.extract_short();
  }

  /**
   * Returns policy error code repository id.
   * 
   * @return IDL:omg.org/CORBA/PolicyErrorCode:1.0, always.
   */
  public static String id()
  {
return IDL:omg.org/CORBA/PolicyErrorCode:1.0;
  }

  /**
   * Delegates call to [EMAIL PROTECTED] Any.insert_short(short)}.
   */
  public static void insert(Any a, short that)
  {
a.insert_short(that);
  }

  /**
   * Delegates call to [EMAIL PROTECTED] InputStream.read_short()}.
   */
  public static short read(InputStream istream)
  {
return istream.read_short();
  }

  /**
   * Returns a typecode of the policy error code, stating it is an alias of
   * codeshort/code, named PolicyErrorCode.
   * 
   * @return a typecode of synchronization scope.
   */
  public static TypeCode type()
  {
recordTypeCode r = new recordTypeCode(TCKind.tk_alias);
r.setName(PolicyErrorCode);
r.setId(id());
r.setContentType(new primitiveTypeCode(TCKind.tk_short));
return r;
  }

  /**
   * Delegates call to [EMAIL PROTECTED] OutputStream.write_short()}.
   */
  public static void write(OutputStream ostream, short value)
  {
ostream.write_short(value);
  }
}___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches]: Patch: UIDefaults fix

2005-10-13 Thread Meskauskas Audrius
Surely. Class.forName uses the class loader of the current class. As the 
core class was loaded by the system class loader, it will not find the 
user code. getSystemClassLoader returns the different loader that has 
loaded the application, same as the default 
Thread.getConextClassLoader() that I would use in this case. I have just 
posted the related message into Classpath discussion list.


Lillian Angel wrote:


When running applications that have their own UI's created, I was
getting exceptions all the time. Tom Tromey suggested this fix a while
back, and it has seemed to fix the problem every time. It has not had
any adverse side effects either.

2005-10-12  Lillian Angel  [EMAIL PROTECTED]

   * javax/swing/UIDefaults.java
   (getUIClass): Fixed to use the system class loader if
   the loader is null.

 




Index: javax/swing/UIDefaults.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/UIDefaults.java,v
retrieving revision 1.23
diff -u -r1.23 UIDefaults.java
--- javax/swing/UIDefaults.java 28 Sep 2005 14:53:40 -  1.23
+++ javax/swing/UIDefaults.java 12 Oct 2005 20:19:20 -
@@ -674,9 +674,9 @@
  return null;
try 
  {

-if (loader != null)
-  return loader.loadClass (className);
-return Class.forName (className);

+if (loader == null)
+  loader = ClassLoader.getSystemClassLoader();
+return loader.loadClass (className);
  }
catch (Exception e)
  {
 




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





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


[cp-patches] FYI: VMStackWalker in CORBA.

2005-10-13 Thread Meskauskas Audrius
This patch looks for a classloader in the classes from the stack trace, 
making the functionality much closer to Sun's. The original idea was 
suggested by Jeroen Frijters, but I decided just to use VMStackWalker 
instead of modifying it.


2005-10-13  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/ObjectCreator.java (forName):
Use gnu.classpath.VMStackWalker.
* gnu/CORBA/Interceptor/Registrator.java,
gnu/CORBA/gnuValueHolder.java,
gnu/CORBA/stubFinder.java,
gnu/javax/rmi/CORBA/DelegateFactory.java,
gnu/javax/rmi/CORBA/StubDelegateImpl.java,
org/omg/CORBA/ORB.java: Load class via ObjectCreator.
Index: gnu/CORBA/ObjectCreator.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/ObjectCreator.java,v
retrieving revision 1.8
diff -u -r1.8 ObjectCreator.java
--- gnu/CORBA/ObjectCreator.java10 Oct 2005 22:49:50 -  1.8
+++ gnu/CORBA/ObjectCreator.java13 Oct 2005 20:21:04 -
@@ -43,6 +43,7 @@
 import gnu.CORBA.CDR.cdrBufOutput;
 import gnu.CORBA.CDR.cdrInput;
 import gnu.CORBA.GIOP.ServiceContext;
+import gnu.classpath.VMStackWalker;
 
 import org.omg.CORBA.Any;
 import org.omg.CORBA.CompletionStatus;
@@ -547,12 +548,42 @@
   }
   
   /**
-   * Load the class with the given name.
+   * Load the class with the given name. This method tries to use the context
+   * class loader first. If this fails, it searches for the suitable class
+   * loader in the caller stack trace. This method is a central point where all
+   * requests to find a class by name are delegated.
*/
-  public static Class forName(String className)
-throws ClassNotFoundException
-{
-  return Class.forName(className, true, 
-Thread.currentThread().getContextClassLoader());
-}
+  public static Class forName(String className) throws ClassNotFoundException
+  {
+try
+  {
+return Class.forName(className, true,
+ Thread.currentThread().getContextClassLoader());
+  }
+catch (ClassNotFoundException nex)
+  {
+/**
+ * Returns the first user defined class loader on the call stack, or
+ * null when no non-null class loader was found.
+ */
+Class[] ctx = VMStackWalker.getClassContext();
+for (int i = 0; i  ctx.length; i++)
+  {
+// Since we live in a class loaded by the bootstrap
+// class loader, getClassLoader is safe to call without
+// needing to be wrapped in a privileged action.
+ClassLoader cl = ctx[i].getClassLoader();
+try
+  {
+if (cl != null)
+  return Class.forName(className, true, cl);
+  }
+catch (ClassNotFoundException nex2)
+  {
+// Try next.
+  }
+  }
+  }
+throw new ClassNotFoundException(className);
+  }
 }
Index: gnu/CORBA/gnuValueHolder.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/gnuValueHolder.java,v
retrieving revision 1.2
diff -u -r1.2 gnuValueHolder.java
--- gnu/CORBA/gnuValueHolder.java   10 Oct 2005 22:49:50 -  1.2
+++ gnu/CORBA/gnuValueHolder.java   13 Oct 2005 18:30:02 -
@@ -123,8 +123,7 @@
 try
   {
 Class helperClass =
-  Class.forName(ObjectCreator.toHelperName(type.id()),
-true, Thread.currentThread().getContextClassLoader());
+  ObjectCreator.forName(ObjectCreator.toHelperName(type.id()));
 
 helper = (BoxedValueHelper) helperClass.newInstance();
   }
Index: gnu/CORBA/stubFinder.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/stubFinder.java,v
retrieving revision 1.3
diff -u -r1.3 stubFinder.java
--- gnu/CORBA/stubFinder.java   10 Oct 2005 22:49:50 -  1.3
+++ gnu/CORBA/stubFinder.java   13 Oct 2005 18:58:20 -
@@ -83,8 +83,7 @@
 
 String stub = _ + s.substring(b + 1) + Stub;
 
-Class stubClass = Class.forName(path + stub, true, 
-  Thread.currentThread().getContextClassLoader());
+Class stubClass = ObjectCreator.forName(path + stub);
 
 return (ObjectImpl) stubClass.newInstance();
   }
Index: gnu/CORBA/Interceptor/Registrator.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Interceptor/Registrator.java,v
retrieving revision 1.4
diff -u -r1.4 Registrator.java
--- gnu/CORBA/Interceptor/Registrator.java  10 Oct 2005 22:49:50 -  
1.4
+++ gnu/CORBA/Interceptor/Registrator.java  13 Oct 2005 18:31:08 -
@@ -39,6 +39,7 @@
 package gnu.CORBA.Interceptor;
 
 import gnu.CORBA.Poa.ORB_1_4;
+import gnu.CORBA.ObjectCreator;
 import gnu.CORBA.gnuCodecFactory;
 
 import org.omg.CORBA.BAD_INV_ORDER;
@@ -182,8 +183,8 @@
 try
   

Asking our experts on class loading.

2005-10-13 Thread Meskauskas Audrius

Hello,

In the OMG specification there are several places where the user 
application passes a class name to the core class library and the method 
inside the core must find and load the user class having this name only.


Class.forName(String) uses classloader that loaded the current class. 
Inside the core it is a system class loader, so there is no use of it 
because the user class is not a part of the core library.


Using thread context class loader seems better, because it is the loader 
that loaded the application. With this loader, typical application finds 
the classes, and it is how our CORBA is currently implemented. The 
problem is, even context class loader may not find a class if part of 
the user application was loaded separately.


This was happening in Mauve tests, where I was observing unexpected 
failures. The default thread context class loader is the loader that was 
used to start the Ant application. Ant loads the Mauve test with its own 
different loader. Then Mauve test classes are not found by the context 
class loader. If the Mauve test calls the core library, the library 
seems having no way to locate the caller class.


To work around the problem, I modified the problematic tests by setting 
temporary the correct class loader as a context class loader for the 
current thread, and now they pass. However if anybody knows the way to 
get the loader of the caller class (stack trace contains the name only - 
no use), it would be great to know it.


Regards
Audrius.

2005-10-13  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/testlet/javax/rmi/CORBA/Tie/RMI_IIOP.java,
   gnu/testlet/org/omg/CORBA/ORB/DirectTest.java,
   gnu/testlet/org/omg/CORBA_2_3/ORB/ValueTypeTest.java,
   
gnu/testlet/org/omg/PortableInterceptor/Interceptor/testInterceptors.java:
   Set the thread context class loader to the loader that loaded 
that test.






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


Re: classpath+jamvm+mauve Howto?

2005-10-13 Thread Meskauskas Audrius

Hi, Norman and David,

There are some talks about the Ant in 
http://developer.classpath.org/mediation/ClasspathCompatiblePrograms. 
Probably they should also be referenced from the First Steps in GNU 
Classpath development 
http://developer.classpath.org/mediation/#head-98025375d10c3b73913bc66719e8f6ecb0d1f430. 
There it is described how to launch the Mauve tests with Ant under JamVM 
rather than under usually default IBM jre. If you cannot force  Ant to 
compile in JamVM mode due some unknown reasons, the seemliest way is 
to launch it under default jre (just type ant), compile Mauve classes 
this way and then rerun Mauve under jre. The classes will not be recompiled.


When I am focused on some specific test, I also usually run it 
separately, from Eclipse. For this, I have a very primitive 
implementation of the TestHarness that just prints the message if the 
check fails and hence does not need anything else to run.


Regards
Audrius




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


[cp-patches] FYI: CORBA class loader fixes in

2005-10-10 Thread Meskauskas Audrius
Class.forName(String) in the core does not load classes from the user 
application. I noticed that this is required in some CORBA classes. This 
patch replaces Class.forName(String) ino Class.forName(String, true, 
Thread.currentThread().getContextClassLoader().


2005-10-10  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/CORBA/Interceptor/Registrator.java,
gnu/CORBA/ObjectCreator.java,
gnu/CORBA/gnuValueHolder.java,
gnu/CORBA/stubFinder.java,
gnu/javax/rmi/CORBA/PortableRemoteObjectDelegateImpl.java,
gnu/javax/rmi/CORBA/StubDelegateImpl.java,
gnu/javax/rmi/CORBA/UtilDelegateImpl.java,
org/omg/CORBA/ORB.java: Use context class loader.
Index: gnu/CORBA/ObjectCreator.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/ObjectCreator.java,v
retrieving revision 1.7
diff -u -r1.7 ObjectCreator.java
--- gnu/CORBA/ObjectCreator.java2 Oct 2005 19:58:00 -   1.7
+++ gnu/CORBA/ObjectCreator.java10 Oct 2005 20:51:50 -
@@ -139,14 +139,14 @@
   suffix = ;
 try
   {
-known = Class.forName(toClassName(JAVA_PREFIX, idl) + suffix);
+known = forName(toClassName(JAVA_PREFIX, idl) + suffix);
 object = known.newInstance();
   }
 catch (Exception ex)
   {
 try
   {
-known = Class.forName(toClassName(CLASSPATH_PREFIX, idl)
+known = forName(toClassName(CLASSPATH_PREFIX, idl)
   + suffix);
 object = known.newInstance();
   }
@@ -343,7 +343,7 @@
 
 try
   {
-c = Class.forName(cn);
+c = forName(cn);
 m_classes.put(IDL, c);
 return c;
   }
@@ -438,7 +438,7 @@
 try
   {
 String helperClassName = object.getClass().getName() + Helper;
-Class helperClass = Class.forName(helperClassName);
+Class helperClass = forName(helperClassName);
 
 Method insert = helperClass.getMethod(insert, new Class[] {
   Any.class, object.getClass() });
@@ -534,7 +534,7 @@
 try
   {
 String helper = toHelperName(idl);
-c = Class.forName(helper);
+c = forName(helper);
 
 m_helpers.put(idl, c);
 return c;
@@ -544,6 +544,15 @@
 return null;
   }
   }
-
   }
+  
+  /**
+   * Load the class with the given name.
+   */
+  public static Class forName(String className)
+throws ClassNotFoundException
+{
+  return Class.forName(className, true, 
+Thread.currentThread().getContextClassLoader());
+}
 }
Index: gnu/CORBA/gnuValueHolder.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/gnuValueHolder.java,v
retrieving revision 1.1
diff -u -r1.1 gnuValueHolder.java
--- gnu/CORBA/gnuValueHolder.java   7 Aug 2005 17:17:43 -   1.1
+++ gnu/CORBA/gnuValueHolder.java   10 Oct 2005 20:47:08 -
@@ -123,7 +123,8 @@
 try
   {
 Class helperClass =
-  Class.forName(ObjectCreator.toHelperName(type.id()));
+  Class.forName(ObjectCreator.toHelperName(type.id()),
+true, Thread.currentThread().getContextClassLoader());
 
 helper = (BoxedValueHelper) helperClass.newInstance();
   }
Index: gnu/CORBA/stubFinder.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/stubFinder.java,v
retrieving revision 1.2
diff -u -r1.2 stubFinder.java
--- gnu/CORBA/stubFinder.java   2 Jul 2005 20:32:09 -   1.2
+++ gnu/CORBA/stubFinder.java   10 Oct 2005 20:48:02 -
@@ -83,7 +83,8 @@
 
 String stub = _ + s.substring(b + 1) + Stub;
 
-Class stubClass = Class.forName(path + stub);
+Class stubClass = Class.forName(path + stub, true, 
+  Thread.currentThread().getContextClassLoader());
 
 return (ObjectImpl) stubClass.newInstance();
   }
Index: gnu/CORBA/Interceptor/Registrator.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Interceptor/Registrator.java,v
retrieving revision 1.3
diff -u -r1.3 Registrator.java
--- gnu/CORBA/Interceptor/Registrator.java  2 Oct 2005 19:58:00 -   
1.3
+++ gnu/CORBA/Interceptor/Registrator.java  10 Oct 2005 20:47:28 -
@@ -182,7 +182,8 @@
 try
   {
 String cn = sk.substring(m_prefix.length());
-Class iClass = Class.forName(cn);
+Class iClass = Class.forName(cn, true,
+  Thread.currentThread().getContextClassLoader());
 ORBInitializer initializer =
   (ORBInitializer) 

Re: request for testing AWT/SWING

2005-10-06 Thread Meskauskas Audrius
I think, the new list would be ok, because this is a new category of 
information. Or maybe the header could have some specific signature 
(people receiving many messages per day from several projects use 
automated sorting).


IMO it would be very great to get this working.

Tom Tromey wrote:


Paul However I wonder if cross reference against daily mauve regressions
Paul would help identify and fix these more quickly?

Yes.

Tom
 





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


Re: [cp-patches] Patch: midi example program

2005-10-05 Thread Meskauskas Audrius
1. It would be interesting to have a MIDI demo. It maybe could even emit 
some sounds, if the devices are available.
2. If the class is executable, should it maybe better be public? Some 
IDE's may not provide context command to run non-public class.


Anthony Green wrote:


Here's a GUI midi demo for the examples collection.

It's just a window with two combo boxes for selecting the MIDI IN and
OUT devices.  It's handy for debugging.

OK?

AG


2005-10-04  Anthony Green  [EMAIL PROTECTED]

* examples/gnu/classpath/examples/midi/Demo.java: New file.


diff -uN examples/gnu/classpath/examples/midi-empty/Demo.java 
examples/gnu/classpath/examples/midi/Demo.java
--- examples/gnu/classpath/examples/midi-empty/Demo.java1969-12-31 
16:00:00.0 -0800
+++ examples/gnu/classpath/examples/midi/Demo.java  2005-10-04 
18:11:48.0 -0700
@@ -0,0 +1,137 @@
+/* Demo.java -- And example of MIDI support
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath examples.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA. */
+
+package gnu.classpath.examples.midi;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+import javax.sound.midi.*;
+
+/**
+ * An example how javax.sound.midi facilities work.
+ */
+class Demo extends Frame implements ItemListener
+{
+  Choice midiInChoice = new Choice();
+  Choice midiOutChoice = new Choice();
+
+  MidiDevice inDevice = null;
+  MidiDevice outDevice = null;
+  
+  ArrayList inDevices = new ArrayList();

+  ArrayList outDevices = new ArrayList();
+
+  public Demo () throws Exception
+  {
+MenuBar mb = new MenuBar ();
+Menu menu = new Menu (File);
+MenuItem quit = new MenuItem(Quit, new MenuShortcut('Q'));
+quit.addActionListener(new ActionListener()
+  {
+   public void actionPerformed(ActionEvent e)
+   {
+ System.exit(0);
+   }
+  });
+menu.add (quit);
+mb.add(menu);
+
+setTitle(synthcity: the GNU Classpath MIDI Demo);

+setLayout(new FlowLayout());
+
+MidiDevice.Info[] infos = MidiSystem.getMidiDeviceInfo();

+
+for (int i = 0; i  infos.length; i++)
+  {
+   MidiDevice device = MidiSystem.getMidiDevice(infos[i]);
+   if (device.getMaxReceivers()  0)
+ {
+   midiOutChoice.addItem(infos[i].getDescription());
+   outDevices.add(device);
+ }
+   if (device.getMaxTransmitters()  0)
+ {
+   midiInChoice.addItem(infos[i].getDescription());
+   inDevices.add(device);
+ }
+  }
+
+setMenuBar (mb);
+add(new Label(MIDI IN: ));
+add(midiInChoice);
+add(new Label(   MIDI OUT: ));
+add(midiOutChoice);
+
+midiInChoice.addItemListener(this);
+midiOutChoice.addItemListener(this);
+
+pack();
+show();
+  }
+  
+  public void itemStateChanged (ItemEvent e)

+  {
+try
+  {
+   if (e.getItemSelectable() == midiInChoice)
+ {
+   if (inDevice != null)
+ inDevice.close();
+	inDevice =  (MidiDevice) 
+	  inDevices.get(midiInChoice.getSelectedIndex());

+ }
+   
+   if (e.getItemSelectable() == midiOutChoice)
+ {
+   if (outDevice != null)
+ outDevice.close();
+   outDevice = (MidiDevice)
+ outDevices.get(midiOutChoice.getSelectedIndex());
+ }
+   
+   if (inDevice != null  outDevice != null)
+ {
+   if (! inDevice.isOpen())
+ inDevice.open();
+   if (! outDevice.isOpen())
+ outDevice.open();
+   Transmitter t = inDevice.getTransmitter();
+   if (t == null)
+ System.err.println (inDevice + .getTransmitter() == null);
+   Receiver r = outDevice.getReceiver();
+   if (r == null)
+ System.err.println (outDevice + .getReceiver() == null);
+	
+	if (t != null  r != null)

+ t.setReceiver (r);
+ }
+  }
+catch (Exception ex)
+  {
+   ex.printStackTrace();
+  }
+  }
+
+  public static void main (String args[]) throws Exception
+{
+  new Demo();
+}
+}




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

[cp-patches] FYI: The small intermediate page form CORBA interoperability.

2005-10-03 Thread Meskauskas Audrius
Andrew Watson , Vice President and Technical Director of the Object 
Management Group, has officially assigned us 20 bit Vendor Minor Code 
Id: 0x47430 (GC). We must use this Id to mark remote Classpath - 
specific system exceptions that other applications may receive from our 
CORBA implementation, while working together. The Id provides namespace 
for 4096 possible exceptions. Until now, we used the code 0x0 
(experimental - anybody can use without registration).


The Vice President also requested from us a web page URL where we should 
describe that our exception codes mean and, if we want, provide other 
information, how to interoperate with our ORB. I suggested to create in 
Classpath Wiki, as the page may need rather frequent alterations and 
clearly depends to mediation category.


However it may not be good to link to Wiki from the external official 
document. Instead, Thomas suggested a good idea to create an 
intermediate hard page from where the Wiki page can be linked.


2005-10-03  Audrius Meskauskas  [EMAIL PROTECTED]

* doc/www.gnu.org/corba.wml: New file.
#include include/layout.wml

subject GNU Classpath CORBA interoperability page

box

boxtitleGNU Classpath::Object management group/boxtitle
boxitem
This page is referenced from the official OMG Vendor tag list,
maintained by the a href = http://www.corba.org/;OMG/a. 
It is is designed to help programmers debugging interoperation
with our ORB. 
/boxitem

boxtitleGNU Classpath::CORBA interoperability/boxtitle
boxitem
ul
liGNU Classpath Vendor Minor Code Id (VMCID) is 0x47430xxx 
(GC\x00\x00 - GC\x0f\xff)./li
/ul
See also:
ul
lia href=http://developer.classpath.org/mediation/CorbaInteroperability;
Interoperability information/a (system exception exception minor codes, 
etc)./li
lia href=bugs.htmlGNU Classpath bug database./a/li
lia href=http://www.gnu.org/software/classpath/classpath.html;
GNU Classpath project/a home page/li
/ul
/boxitem

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


[cp-patches] FYI: javax.rmi.CORBA compatibility fixes.

2005-10-03 Thread Meskauskas Audrius

2005-10-03  Audrius Meskauskas  [EMAIL PROTECTED]

* javax/rmi/CORBA/ValueHandler.java (getRunTimeCodeBase): Fixed return type.
* gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java 
(getRunTimeCodeBase): Implemented.




Index: gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java
===
RCS file: 
/cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java,v
retrieving revision 1.1
diff -u -r1.1 ValueHandlerDelegateImpl.java
--- gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java   2 Oct 2005 19:58:01 
-   1.1
+++ gnu/javax/rmi/CORBA/ValueHandlerDelegateImpl.java   3 Oct 2005 14:28:40 
-
@@ -38,8 +38,11 @@
 
 package gnu.javax.rmi.CORBA;
 
+import gnu.CORBA.CDR.gnuRuntime;
+
 import org.omg.CORBA.CustomMarshal;
 import org.omg.CORBA.portable.Streamable;
+import org.omg.SendingContext.RunTime;
 
 import java.io.Externalizable;
 import java.io.ObjectStreamClass;
@@ -57,9 +60,14 @@
   extends gnuRmiUtil
   implements ValueHandler
 {
-  public Runtime getRunTimeCodeBase()
+  /**
+   * This implementation associates RunTime with stream rather than with the
+   * value handler and this method is not used in the implementation. It is
+   * implemented just for the sake of compatibility. 
+   */
+  public RunTime getRunTimeCodeBase()
   {
-throw new Error(Not implemented for ValueHandler);
+return new gnuRuntime(null, null);
   }
 
   /**
Index: javax/rmi/CORBA/ValueHandler.java
===
RCS file: /cvsroot/classpath/classpath/javax/rmi/CORBA/ValueHandler.java,v
retrieving revision 1.5
diff -u -r1.5 ValueHandler.java
--- javax/rmi/CORBA/ValueHandler.java   2 Oct 2005 19:58:01 -   1.5
+++ javax/rmi/CORBA/ValueHandler.java   3 Oct 2005 14:16:48 -
@@ -79,7 +79,7 @@
* 
* @return the codebase.
*/
-  Runtime getRunTimeCodeBase();
+  RunTime getRunTimeCodeBase();
 
   /**
* Indicates that the given class is responsible itself for writing its
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


GNU Classpath CORBA obtains the official Vendor Minor Code Id: 0x47430 (GC).

2005-10-03 Thread Meskauskas Audrius
Andrew Watson , Vice President and Technical Director of the Object 
Management Group, has officially assigned us 20 bit Vendor Minor Code 
Id: 0x47430 (GC). We must use this Id to mark remote Classpath - 
specific system exceptions that other applications may receive from our 
CORBA implementation, while working together. The Id provides namespace 
for 4096 possible exceptions. Until now, we used the code 0x0 
(experimental - anybody can use without registration).


Obtaining the VMCID means that GNU Classpath now is a recogniseable type 
of node in the highly interoperable CORBA world. Any CORBA server or 
client can recognise our exception even if it was thrown from the other 
end of the world and the platform of the remote corresponent was 
initially unknown. This should increase the possibility for us to get a 
bug report.


The Vice President also requested from us a web page URL where we should 
describe that our exception codes mean and, if we want, provide other 
information, how to interoperate with our ORB. The simpliest solution is 
to create it in Classpath Wiki - we must just be sure that the page will 
stay available in the future. This URL will be included into the Vendor 
Tag List, together with our VMCID.


The vendor tag list (old): http://www.omg.org/docs/ptc/05-04-04.txt
The documentation about the VMCID: http://www.omg.org/docs/ptc/99-02-01.pdf

I think, we may list this event in the Classpath news.

Audrius.


Here's the entry I've created for you in the CORBA tags file:

--

Holder:   GNU Classpath project
Contact:  Audrius Meskauskas
Email:[EMAIL PROTECTED]
URL:
Last update:  29th September 2005
Status:   Current

  1 VMCID   0x47430xxx   (GC\x00\x00 - GC\x0f\xff)

--

The URL field in the entry is optional - the intention is to put in the URL
of a page designed to help programmers debugging interoperation with your
ORB. Here are some examples:

   ftp://ftp.parc.xerox.com/pub/ilu/misc/ilu-use-of-omg-tags.html

   http://www.cs.wustl.edu/~schmidt/ACE_wrappers/TAO/docs/Tags.html

If you have a page like this I would be happy to put it in the allocation
file.

   Regards,

Andrew
Andrew Watson  Tel: +44 1223 510398
Vice President  Technical Director,   Email:   [EMAIL PROTECTED]
Object Management Grouphttp://www.omg.org/~andrew


 





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


[cp-patches] FYI: Removing unneeded files from javax.rmi.CORBA and related.

2005-10-02 Thread Meskauskas Audrius
The following files are no longer in use and can be removed. These stubs 
substituted the currently existing CORBA classes.


2005-10-02  Audrius Meskauskas  [EMAIL PROTECTED]

* gnu/javax/rmi/PortableServer.java,
gnu/javax/rmi/CORBA/ValueHandlerImpl.java,
javax/rmi/BAD_OPERATION.java,
javax/rmi/ORB.java,
javax/rmi/CORBA/ObjectImpl.java,
javax/rmi/CORBA/SystemException.java: Deleted.



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


[cp-patches] Re: [commit-cp] classpath ./ChangeLog gnu/CORBA/CDR/Vio.java gn...

2005-10-02 Thread Meskauskas Audrius

Hi, Andreas. Thanks.

* gnu/javax/rmi/CORBA/corbaObjectOutput.java (main): Removed.

Andreas Tobler wrote:


Hi Audrius,

Found 3 semantic errors compiling 
../../classpath/gnu/javax/rmi/CORBA/corbaObjectOutput.java:


Index: gnu/javax/rmi/CORBA/corbaObjectOutput.java
===
RCS file: 
/cvsroot/classpath/classpath/gnu/javax/rmi/CORBA/corbaObjectOutput.java,v
retrieving revision 1.1
diff -u -r1.1 corbaObjectOutput.java
--- gnu/javax/rmi/CORBA/corbaObjectOutput.java  2 Oct 2005 19:58:01 -   
1.1
+++ gnu/javax/rmi/CORBA/corbaObjectOutput.java  2 Oct 2005 20:39:26 -
@@ -38,21 +38,12 @@
 
 package gnu.javax.rmi.CORBA;
 
-import gnu.CORBA.CDR.cdrBufOutput;
-
-import org.omg.CORBA.Any;
-import org.omg.CORBA.ORB;
-import org.omg.CORBA_2_3.portable.InputStream;
 import org.omg.CORBA_2_3.portable.OutputStream;
 
 import java.io.IOException;
 import java.io.ObjectOutput;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-
-import debugging.CORBA_stream;
 
 /**
  * A class to substitute as an ObjectOutputStream for objects using writeObject
@@ -214,61 +205,6 @@
 throws IOException
   {
 stream.write_wstring(str);
-  }
-
-  public static void main(String[] args)
-  {
-/**
- * The arguments for writeObject.
- */
-Class[] WRITE_OBJECT_ARGS = new Class[] { ObjectOutputStream.class };
-
-try
-  {
-ArrayList ara = new ArrayList(123);
-ara.add(one);
-ara.add(two);
-ara.add(Three);
-
-ORB orb = ORB.init(new String[0], null);
-Any a = orb.create_any();
-OutputStream out = (OutputStream) a.create_output_stream();
-out.write_value(ara);
-
-InputStream in = (InputStream) out.create_input_stream();
-
-int p = 0;
-try
-  {
-while (true)
-  {
-System.out.println(p +   + in.read_octet());
-p++;
-  }
-  }
-catch (Exception ex)
-  {
-  }
-
-new cdrBufOutput().write_Value(ara);
-
-Method m = ara.getClass().getDeclaredMethod(writeObject,
-  WRITE_OBJECT_ARGS);
-
-CORBA_stream c;
-ObjectOutputStream stream = new corbaObjectOutput(
-  c = new CORBA_stream(), ara, new gnuRmiUtil());
-
-m.setAccessible(true); // May be private.
-m.invoke(ara, new Object[] { stream });
-
-System.out.println(c.b);
-
-  }
-catch (Exception ex)
-  {
-ex.printStackTrace();
-  }
   }
 
   /**
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] FYI: Implemented missing RMI method

2005-10-01 Thread Meskauskas Audrius
Since jdk 1.3 both CORBA and RMI-IIOP should be able to load and run 
remote classes from the URL's that can be automatically included into 
IIOP messages. This allows to transfer the algorithm to remote side 
rather than just transferring the data. Potentially very powerful 
feature, but such code maybe should run as untrusted, same as for 
applets.  See bug #23130 for details.


Thomas Fitzsimmons wrote:


On Thu, 2005-09-29 at 09:19 +0200, Meskauskas Audrius wrote:
 

Oh, this is great! In future that thing will also load classes for 
javax.rmi that I am finishing in days.
   



Finishing to the 1.4 level or to the 1.5 level?  In general, I think we
should be aiming for full 1.5 API coverage now, even if we can't
genericize things yet.

Tom
 

 





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


Re: [cp-patches] [generics] Copied org/omg/PortableServer/portable/Delegate.java: How can this compile?

2005-09-22 Thread Meskauskas Audrius

Hi, Jeroen

Strange, this class is involved into classes from gnu.CORBA.Poa package 
like gnu.CORBA.Poa.gnuServantObject, and the code without it should not 
compile. When possible, please check if the compiler does not mix it 
with org.omg.CORBA.portable.Delegate. It is a real disaster to have 
identical names just in different packages.


Regards
Audrius.


Jeroen Frijters wrote:


Hi,

org/omg/PortableServer/portable/Delegate.java was missing on the
generics branch, so I copied it over.

Regards,
Jeroen


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


 





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


[cp-patches] FYI: Closing swing timer bug 23918

2005-09-16 Thread Meskauskas Audrius

This closes 23918. I also add new Mauve test for this case..

2005-09-16Audrius Meskauskas  [EMAIL PROTECTED]

* javax.swing.Timer.java (Waker.run): Do not enter loop on repeats = false.
Index: javax/swing/Timer.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/Timer.java,v
retrieving revision 1.20
diff -u -r1.20 Timer.java
--- javax/swing/Timer.java  2 Jul 2005 20:32:49 -   1.20
+++ javax/swing/Timer.java  16 Sep 2005 18:37:28 -
@@ -72,24 +72,25 @@
 
   queueEvent();
 
-  while (running)
-{
-  try
-{
-  sleep(delay);
-}
-  catch (InterruptedException e)
-{
-  return;
-}
-  queueEvent();
+  if (repeats)
+while (running)
+  {
+try
+  {
+sleep(delay);
+  }
+catch (InterruptedException e)
+  {
+return;
+  }
+queueEvent();
 
-  if (logTimers)
-System.out.println(javax.swing.Timer - clocktick);
+if (logTimers)
+  System.out.println(javax.swing.Timer - clocktick);
 
-  if ( ! repeats)
-break;
-}
+if ( ! repeats)
+  break;
+  }
   running = false;
 }
   catch (Exception e)
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] Patch: improve error handling in String

2005-09-15 Thread Meskauskas Audrius

Would it be better to use InternalError?  That is a little more specific.

That one is more difficult to chain (.initCause() must be used).

David Daney wrote:


Anthony Green wrote:


-  // XXX - Ignore coding exceptions? They shouldn't really happen.
-  return null;
+  // This shouldn't really happen.
+  throw new Error(e);






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


Re: GNU Classpath and JVMs

2005-09-15 Thread Meskauskas Audrius
GNU Classpath is a library. Depending on the needs of you project, 
significant part of it can be used as an alternative library for an 
arbitrary jre's. Many newer packages provide standard mechanism to 
plug-in the alternative implementation just by setting several system 
poperties to the alternative class names.


Audrius.




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


[cp-patches] FYI: Hashcode for NameComponent.

2005-09-14 Thread Meskauskas Audrius
This is a hashcode function for the NameComponent, computed using Adler 
by content rather than by identity (same as .equals works).


2005-09-14Audrius Meskauskas  [EMAIL PROTECTED]

* org/omg/CosNaming/NameComponent (hashCode): New method.


Index: org/omg/CosNaming/NameComponent.java
===
RCS file: /cvsroot/classpath/classpath/org/omg/CosNaming/NameComponent.java,v
retrieving revision 1.3
diff -u -r1.3 NameComponent.java
--- org/omg/CosNaming/NameComponent.java2 Jul 2005 20:32:59 -   
1.3
+++ org/omg/CosNaming/NameComponent.java14 Sep 2005 19:06:22 -
@@ -40,6 +40,8 @@
 
 import org.omg.CORBA.portable.IDLEntity;
 
+import java.util.zip.Adler32;
+
 /**
  * The name component, a node in the multi-comonent name.
  *
@@ -115,4 +117,14 @@
   {
 return id + . + kind;
   }
-}
\ No newline at end of file
+
+  /**
+   * Return the hashCode of this NameComponent.
+   */
+  public int hashCode()
+  {
+Adler32 adler = new Adler32();
+adler.update(toString().getBytes());
+return (int) adler.getValue()  Integer.MAX_VALUE;
+  }
+}
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: assert usage: Starting to use assertions.

2005-09-10 Thread Meskauskas Audrius

That is really great. I start using assertions in my code.

Tom Tromey wrote:


Robert == Robert Schuster [EMAIL PROTECTED] writes:
   



Robert Roman started using the assert statement.
Robert Do we finally support this officially?

IMO we ought to.  We have all the runtime support.  All the compilers
we recommend support it (and usually give the option to disable code
generation for it).

Robert Can we work out some recommendation when to use
Robert assert ( expr ); OR
Robert assert ( expr ) : what to say here?; OR

How about treating it like 'return' and only using parens if the line
wraps?

   assert something;

   assert something : something_else;

And, if you need to wrap the line, consider wrapping before the ':'
(i.e., treat it as an operator).

As for the optional message, I think that can be done on a
case-by-case basis.

Tom


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


 





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


Re: gnu.java.nio

2005-09-09 Thread Meskauskas Audrius


Craig Combs wrote:


Two questions:
 
1)  If I read this correct the classes in the package will determine 
the encoding of input and convert it to a specified encoding that I 
specify without needing to know the orginal encoding of the file?  Of 
course depding that I can find a match and if I can not I assume it 
throws and exception or defaults to the system encoding.


The FileReader reads using native encoding. If you need to read a file 
using some other charset, read from


new InputStreamReader(new FileReader(myFile), Charset.forName(my 
charset) ).


 2) can classpath be incldued in a library of application say a search 
engine without making the search engine GPL.  I'm using lucene and 
would like to keep it under Apache and not GPL.  Can some clarify what 
an independ module a little be more?


When GNU Classpath is used unmodified as the core class library for a 
program written in the java programming language it does not affect the 
licensing for distributing this program directly.


See http://www.gnu.org/software/classpath/license.html for details.

Regards
Audrius.







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


Re: Performing Encoding Discovery

2005-09-09 Thread Meskauskas Audrius
The idea is impressive, but the automated discovering of encoding may be 
something outside the boundaries of the standard Java API and hence 
outside the scope of this project.


Craig Combs wrote:


Does anybody have a better way of doing this?
 
I would like to search a set of documents but the documents can be 
UTF-8, SHIFT-JIS, or US_ASCII.  In order for me to index the files 
correctly I need to know the encoding of the file so I can convert to 
unicode because query searches are converted to Unicode and the query 
must be encoded the same way the document was indexed.
 
My only thought is to take a sampling of bytes and then covert the 
bytes in each language to create a probability matrix of the 
encoding.  Now I was planning on using the default encoding of the 
system and the languages defined for use in the directory for stemming 
and stop word analyzing for hints to the encoding. 
 
Does gnu.java.nio have any functions for giving back probable charsets 
of a byte stream?  Otherwise I suppose I'll just write my own.
 
-Craig


*//*





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


Starting work on javax.rmi.CORBA

2005-09-07 Thread Meskauskas Audrius
Despite  the first classes of javax.rmi.CORBA were written long time ago 
by Wu Gansha, this package is still largely incomplete and non 
functional. This work could not be done properly before completing 
org.omg.CORBA.ORB class.


I plan to use the documentation at 
http://www.omg.org/cgi-bin/doc?formal/03-09-04.


Regards
Audrius.




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


[cp-patches] Re: XML status: suggesting test page: Suggesting Test cases section for Wiki.

2005-09-02 Thread Meskauskas Audrius
I would suggest to have a separate linked Test cases section, where we 
could put the links to such kind of documentation. The good conformance 
tests are important argument in persuading people about the completeness 
of our implementation, especially for packages defining  mainly abstract 
classes and interfaces. . The  javax.xml.* API is a typical example of 
such package.


Chris Burdess wrote:

I have updated the XSLT conformance page 
(http://www.zen60362.zen.co.uk/xslt/) with the results for current 
Classpath HEAD. There is a slight regression (8 test cases), I'm 
afraid - I don't know why this is but am looking into it.


I have also added some XML developer tasks to the mediation Wiki.





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


[cp-patches] FYI: Implementing corbaname: object reference parsing in CORBA ORB.

2005-09-02 Thread Meskauskas Audrius

This patch extends the ORB.string_to_object supported protocol set by
corbaname: protocol.

2005-09-02  [EMAIL PROTECTED]

   * gnu/CORBA/IOR_Delegate.java (request),
   gnu/CORBA/SocketRepository.java (get_socket),
   gnu/CORBA/gnuRequest (getParameterStream),
   gnu/CORBA/NamingService/NameParser.java,
   gnu/CORBA/NamingService/NamingServiceTransient.java: Rewritten.
   * gnu/CORBA/Functional_ORB.java (nameParser): New field.
   (string_to_object): Rewritten.
   (ior_to_object): Made public.
   * org/omg/CORBA/ORB.java (string_to_object):
   Documentation update.
? gnu/javax/swing/plaf/gtk/icons/Thumbs.db
Index: gnu/CORBA/Functional_ORB.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/Functional_ORB.java,v
retrieving revision 1.17
diff -u -r1.17 Functional_ORB.java
--- gnu/CORBA/Functional_ORB.java   29 Aug 2005 21:18:31 -  1.17
+++ gnu/CORBA/Functional_ORB.java   2 Sep 2005 10:25:56 -
@@ -386,6 +386,11 @@
* The port, on that the name service is expected to be running.
*/
   private int ns_port = 900;
+  
+  /**
+   * The name parser.
+   */
+  NameParser nameParser = new NameParser();
 
   /**
* The instance, stored in this field, handles the asynchronous dynamic
@@ -945,32 +950,13 @@
*/
   public org.omg.CORBA.Object string_to_object(String an_ior)
   {
-int p = an_ior.indexOf(':');
-if (p  0)
-  throw new BAD_PARAM(IOR: or CORBALOC: prefix expected);
-
-String prefix = an_ior.substring(0, p).toLowerCase();
-
-if (prefix.equals(ior))
-  {
-IOR ior = IOR.parse(an_ior);
-return ior_to_object(ior);
-  }
-else if (prefix.equals(corbaloc))
-  {
-java.lang.Object r = NameParser.corbaloc(an_ior, this);
-if (r instanceof IOR)
-  return ior_to_object((IOR) r);
-else
-  return (org.omg.CORBA.Object) r;
-  }
-else throw new DATA_CONVERSION(Unsupported prefix '+prefix+');
+return nameParser.corbaloc(an_ior, this);
   }
   
   /**
* Convert ior reference to CORBA object.
*/
-  private org.omg.CORBA.Object ior_to_object(IOR ior)
+  public org.omg.CORBA.Object ior_to_object(IOR ior)
   {
 org.omg.CORBA.Object object = find_local_object(ior);
 if (object == null)
Index: gnu/CORBA/IOR_Delegate.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/IOR_Delegate.java,v
retrieving revision 1.6
diff -u -r1.6 IOR_Delegate.java
--- gnu/CORBA/IOR_Delegate.java 28 Aug 2005 11:23:36 -  1.6
+++ gnu/CORBA/IOR_Delegate.java 2 Sep 2005 14:23:24 -
@@ -408,10 +408,11 @@
 request.set_target(target);
 request.setOperation(operation);
 
-request.getParameterStream().response_expected = response_expected;
+streamRequest out = request.getParameterStream();
+out.response_expected = response_expected;
 request.setORB(orb);
 
-return request.getParameterStream();
+return out;
   }
 
   /**
Index: gnu/CORBA/SocketRepository.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/SocketRepository.java,v
retrieving revision 1.2
diff -u -r1.2 SocketRepository.java
--- gnu/CORBA/SocketRepository.java 2 Jul 2005 20:32:09 -   1.2
+++ gnu/CORBA/SocketRepository.java 2 Sep 2005 15:38:16 -
@@ -39,6 +39,7 @@
 package gnu.CORBA;
 
 import java.net.Socket;
+import java.net.SocketException;
 
 import java.util.HashMap;
 
@@ -70,16 +71,18 @@
 
   /**
* Get a socket.
-   *
+   * 
* @param key a socket key.
-   *
-   * @return an opened socket for reuse, null if no such
-   * available or it is closed.
+   * 
+   * @return an opened socket for reuse, null if no such available or it is
+   * closed.
*/
   public static Socket get_socket(Object key)
   {
 Socket s = (Socket) sockets.get(key);
-if (s != null  s.isClosed())
+if (s == null)
+  return null;
+else if (s.isClosed())
   {
 sockets.remove(key);
 return null;
@@ -87,6 +90,15 @@
 else
   {
 sockets.remove(key);
+try
+  {
+// Set one minute time out that will be changed later.
+s.setSoTimeout(60*1000);
+  }
+catch (SocketException e)
+  {
+s = null;
+  }
 return s;
   }
   }
Index: gnu/CORBA/gnuRequest.java
===
RCS file: /cvsroot/classpath/classpath/gnu/CORBA/gnuRequest.java,v
retrieving revision 1.10
diff -u -r1.10 gnuRequest.java
--- gnu/CORBA/gnuRequest.java   28 Aug 2005 11:23:36 -  1.10
+++ gnu/CORBA/gnuRequest.java   2 Sep 2005 15:23:10 -
@@ -340,6 +340,21 @@
 m_parameter_buffer.setCodeSet(cxCodeSet.negotiate(ior.Internet.CodeSets));
 m_parameter_buffer.setOrb(orb);
 

[cp-patches] FYI: PortableInterceptor compatibility fixes.

2005-09-02 Thread Meskauskas Audrius

2005-09-02  [EMAIL PROTECTED]

   * org/omg/PortableInterceptor/CurrentOperations.java: Inherit 
from org.omg.CORBA.CurrentOperations.
   * 
org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java

   (send_poll): Remove ForwardRequest from declaration.
Index: org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java,v
retrieving revision 1.1
diff -u -r1.1 ClientRequestInterceptorOperations.java
--- org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java 28 Aug 
2005 11:23:37 -  1.1
+++ org/omg/PortableInterceptor/ClientRequestInterceptorOperations.java 2 Sep 
2005 17:04:36 -
@@ -123,10 +123,6 @@
* @throws SystemException if it does, the send_poll is not called for the
* subsequent interceptors, calling receive_exception instead. The completion
* status of this exception must be COMPLETED_NO.
-   *
-   * @throws ForwardRequest to forward the invocation to another target. The
-   * send_request is not called for the subsequent interceptors, calling
-   * receive_other instead.
*/
-  void send_poll(ClientRequestInfo info) throws ForwardRequest;
+  void send_poll(ClientRequestInfo info);
 }
Index: org/omg/PortableInterceptor/CurrentOperations.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/PortableInterceptor/CurrentOperations.java,v
retrieving revision 1.1
diff -u -r1.1 CurrentOperations.java
--- org/omg/PortableInterceptor/CurrentOperations.java  28 Aug 2005 11:23:37 
-  1.1
+++ org/omg/PortableInterceptor/CurrentOperations.java  2 Sep 2005 17:05:32 
-
@@ -54,13 +54,14 @@
  * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
  */
 public interface CurrentOperations
+  extends org.omg.CORBA.CurrentOperations
 {
   /**
* Get data from the slot with the given slot_id.
*
* @param slot_id the slot slot_id.
*
-   * @return the Any that was stored in the slot. If the given slot has 
not been
+   * @return the Any that was stored in the slot. If the given slot has not 
been
* set, the returned Any contains a type code with a TCKind value of tk_null
* and has no value.
*
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] FYI: New classes for 1.4 org.omg.CosNaming.

2005-09-02 Thread Meskauskas Audrius

2005-09-02  [EMAIL PROTECTED]

   * org/omg/CosNaming/NamingContextOperations.java:
   Do not inherit from CORBA object.
   * org/omg/CosNaming/_NamingContextExtImplBase.java (_methods),
   omg/CosNaming/_NamingContextImplBase.java (methods):
   Made package private.
   * omg/CosNaming/NamingContextPOA.java,
   omg/CosNaming/NamingContextExtPOA.java,
   org/omg/CosNaming/BindingIteratorPOA.java: New files.
? org/omg/CosNaming/BindingIteratorPOA.java
? org/omg/CosNaming/NamingContextExtPOA.java
? org/omg/CosNaming/NamingContextPOA.java
Index: org/omg/CosNaming/NamingContextOperations.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/CosNaming/NamingContextOperations.java,v
retrieving revision 1.2
diff -u -r1.2 NamingContextOperations.java
--- org/omg/CosNaming/NamingContextOperations.java  2 Jul 2005 20:32:59 
-   1.2
+++ org/omg/CosNaming/NamingContextOperations.java  2 Sep 2005 17:49:58 
-
@@ -55,7 +55,7 @@
  * @author Audrius Meskauskas, Lithuania ([EMAIL PROTECTED])
  */
 public interface NamingContextOperations
-  extends org.omg.CORBA.Object, IDLEntity
+  extends IDLEntity
 {
   /**
* Gives the object a name, valid in this context.
Index: org/omg/CosNaming/_NamingContextExtImplBase.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/CosNaming/_NamingContextExtImplBase.java,v
retrieving revision 1.3
diff -u -r1.3 _NamingContextExtImplBase.java
--- org/omg/CosNaming/_NamingContextExtImplBase.java2 Jul 2005 20:32:59 
-   1.3
+++ org/omg/CosNaming/_NamingContextExtImplBase.java2 Sep 2005 18:54:04 
-
@@ -66,7 +66,7 @@
   extends _NamingContextImplBase
   implements NamingContextExt, InvokeHandler
 {
-  private static Hashtable _methods = new Hashtable();
+  static Hashtable _methods = new Hashtable();
 
   static
   {
Index: org/omg/CosNaming/_NamingContextImplBase.java
===
RCS file: 
/cvsroot/classpath/classpath/org/omg/CosNaming/_NamingContextImplBase.java,v
retrieving revision 1.4
diff -u -r1.4 _NamingContextImplBase.java
--- org/omg/CosNaming/_NamingContextImplBase.java   2 Jul 2005 20:32:59 
-   1.4
+++ org/omg/CosNaming/_NamingContextImplBase.java   2 Sep 2005 18:17:20 
-
@@ -78,8 +78,9 @@
 
   /**
* As there are quite many methods, it may be sensible to use the hashtable.
+   * This field is also reused in NamingContextPOA.
*/
-  private static Hashtable methods = new Hashtable();
+  static Hashtable methods = new Hashtable();
 
   /**
* Put all methods into the table.
/* NamingContextPOA.java --
   Copyright (C) 2005 Free Software Foundation, Inc.

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.

Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
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 org.omg.CosNaming;

import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.CompletionStatus;
import org.omg.CORBA.ObjectHelper;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.CosNaming.NamingContextPackage.AlreadyBound;
import org.omg.CosNaming.NamingContextPackage.AlreadyBoundHelper;
import org.omg.CosNaming.NamingContextPackage.CannotProceed;
import 

  1   2   3   >