Re: [cp-patches] Patch: NullPointerException in ToolTipManger #11538

2005-06-17 Thread Roman Kennke

Hi Lillian,


This simple patch fixes the NullPointerException in the function
mousePressed in ToolTipManager. Attached is the patch.

2005-06-15  Lillian Angel  [EMAIL PROTECTED]

* javax/swing/ToolTipManager.java
Fixed Bug #11538.
(mousePressed): check if currentComponent is null.
If so, it should be equal to the current source.
 



That looks good. I committed this, thank you.

/Roman



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


Re: [cp-patches] Patch: Scroll pane containing a JList with a preferred size.

2005-06-17 Thread Roman Kennke

Hi Lillian,

Lillian Angel wrote:


I fixed these 2 bugs. Attached is a patch file.
 




--- javax/swing/JViewport.java  27 May 2005 21:12:46 -  1.20
+++ javax/swing/JViewport.java  16 Jun 2005 16:56:53 -
@@ -344,6 +344,12 @@
  viewListener = createViewListener();
v.addComponentListener(viewListener);
add(v);
+
+Dimension vd = v.getPreferredSize();

+   Object p = getParent();
+   if (p instanceof JScrollPane  !vd.equals( new Dimension() ))
+   ( (JScrollPane) p ).setPreferredSize( vd );
+
fireStateChanged();

  }
  }
 

I don't think that we should mess with the preferredSize of the parent. 
Is there no other/better solution to these bugs? I would guess, that it 
must be something in ViewportLayout, which is responsible for resizing 
and repositioning the JList (or whatever child). If you think that your 
solution is correct, then maybe you could write a testcase that shows 
that the JDK is behaving like this too.


/Roman



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


[cp-patches] [generics] FYI: java/util/TreeMap.java java/lang/ThreadLocal.java compilation fixes

2005-06-17 Thread Jeroen Frijters
Hi,

I committed the attached patch.

Regards,
Jeroen

2005-06-17  Jeroen Frijters  [EMAIL PROTECTED]

* java/lang/ThreadLocal.java,
java/util/TreeMap.java: Fixes to make compiling with Eclipse
Java
Compiler SVN HEAD possible.
Index: java/lang/ThreadLocal.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/ThreadLocal.java,v
retrieving revision 1.4.2.4
diff -u -r1.4.2.4 ThreadLocal.java
--- java/lang/ThreadLocal.java  20 Apr 2005 20:22:27 -  1.4.2.4
+++ java/lang/ThreadLocal.java  17 Jun 2005 13:03:59 -
@@ -101,13 +101,20 @@
* We can't use this, because a subclass may override equals/hashCode
* and we need to use object identity for the map.
*/
-  final Key key = new Key();
+  final Key key = new Key(this);
 
-  class Key
+  static class Key
   {
+private ThreadLocal outer;
+
+Key(ThreadLocal outer)
+{
+  this.outer = outer;
+}
+
 ThreadLocal get()
 {
-  return ThreadLocal.this;
+  return outer;
 }
   }
 
Index: java/util/TreeMap.java
===
RCS file: /cvsroot/classpath/classpath/java/util/TreeMap.java,v
retrieving revision 1.23.2.6
diff -u -r1.23.2.6 TreeMap.java
--- java/util/TreeMap.java  19 Feb 2005 10:50:44 -  1.23.2.6
+++ java/util/TreeMap.java  17 Jun 2005 13:04:02 -
@@ -462,7 +462,7 @@
*/
   public SortedMapK, V headMap(K toKey)
   {
-return new SubMap(nil, toKey);
+return new SubMap((K)(Object)nil, toKey);
   }
 
   /**
@@ -681,7 +681,7 @@
*/
   public SortedMapK, V tailMap(K fromKey)
   {
-return new SubMap(fromKey, nil);
+return new SubMap(fromKey, (K)(Object)nil);
   }
 
   /**
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] [generics] RFC: VM interface changes

2005-06-17 Thread Jeroen Frijters
Hi,

Here is the first part of my proposed VM interface changes to make the
VM interface more compatible with HEAD.

Please comment.

Regards,
Jeroen
Index: java/lang/Class.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/Class.java,v
retrieving revision 1.22.2.15
diff -u -r1.22.2.15 Class.java
--- java/lang/Class.java8 Jun 2005 23:24:52 -   1.22.2.15
+++ java/lang/Class.java17 Jun 2005 13:03:59 -
@@ -124,7 +124,7 @@
   final transient Object vmdata;
 
   /** newInstance() caches the default constructor */
-  private transient Constructor constructor;
+  private transient ConstructorT constructor;
 
   /**
* Class is non-instantiable from Java code; only the VM can create
@@ -1318,7 +1318,7 @@
*/
   public T cast(Object obj)
   {
-return VMClass.cast(obj, this);
+return (T)VMClass.cast(obj, this);
   }
 
   /**
@@ -1388,7 +1388,7 @@
*/
   public T[] getEnumConstants()
   {
-return VMClass.getEnumConstants(this);
+return (T[])VMClass.getEnumConstants(this);
   }
 
   /**
@@ -1622,7 +1622,15 @@
*/
   public Type[] getGenericInterfaces()
   {
-return VMClass.getGenericInterfaces(this);
+if (isPrimitive())
+  return new Type[0];
+
+String sig = VMClass.getClassSignature(this);
+if (sig == null)
+  return getInterfaces();
+
+// XXX
+throw new Error(Not implemented);
   }
 
   /**
@@ -1656,7 +1664,18 @@
*/
   public Type getGenericSuperclass()
   {
-return VMClass.getGenericSuperclass(this);
+if (isArray())
+  return Object.class;
+
+if (isPrimitive() || isInterface() || this == Object.class)
+  return null;
+
+String sig = VMClass.getClassSignature(this);
+if (sig == null)
+  return getSuperclass();
+
+// XXX
+throw new Error(Not implemented);
   }
 
   /**
@@ -1673,7 +1692,12 @@
*/
   public TypeVariableClassT[] getTypeParameters()
   {
-return VMClass.getTypeParameters(this);
+String sig = VMClass.getClassSignature(this);
+if (sig == null)
+  return (TypeVariableClassT[])new TypeVariable[0];
+
+// XXX
+throw new Error(Not implemented);
   }
 
   /**
Index: java/lang/System.java
===
RCS file: /cvsroot/classpath/classpath/java/lang/System.java,v
retrieving revision 1.38.2.11
diff -u -r1.38.2.11 System.java
--- java/lang/System.java   4 Apr 2005 00:24:48 -   1.38.2.11
+++ java/lang/System.java   17 Jun 2005 13:03:59 -
@@ -495,7 +495,7 @@
   sm.checkPermission(new RuntimePermission(getenv.*));
 if (environmentMap == null)
   {
-   ListString environ = VMSystem.environ();
+   ListString environ = (ListString)VMSystem.environ();
MapString,String variables = new EnvironmentMap();
for (String pair : environ)
  {
Index: vm/reference/java/lang/VMClass.java
===
RCS file: /cvsroot/classpath/classpath/vm/reference/java/lang/VMClass.java,v
retrieving revision 1.10.2.7
diff -u -r1.10.2.7 VMClass.java
--- vm/reference/java/lang/VMClass.java 8 Jun 2005 23:24:52 -   1.10.2.7
+++ vm/reference/java/lang/VMClass.java 17 Jun 2005 13:04:07 -
@@ -341,7 +341,7 @@
* @param klass the class whose simple name should be returned. 
* @return the simple name for this class.
*/
-  static String getSimpleName(Class? klass)
+  static String getSimpleName(Class klass)
   {
 if (isArray(klass))
   {
@@ -403,7 +403,7 @@
* @return the annotations directly defined by the specified class.
* @since 1.5
*/
-  static native Annotation[] getDeclaredAnnotations(Class? klass);
+  static native Annotation[] getDeclaredAnnotations(Class klass);
 
   /**
* p
@@ -440,7 +440,7 @@
* class doesn't have a canonical name.
* @since 1.5
*/
-  static String getCanonicalName(Class? klass)
+  static String getCanonicalName(Class klass)
   {
 if (isArray(klass))
   {
@@ -468,7 +468,7 @@
* a top-level class.
* @since 1.5
*/
-  static native Class? getEnclosingClass(Class? klass);
+  static native Class getEnclosingClass(Class klass);
 
   /**
* Returns the constructor which immediately encloses the specified class.
@@ -482,7 +482,7 @@
* is returned.
* @since 1.5
*/
-  static native Constructor? getEnclosingConstructor(Class? klass);
+  static native Constructor getEnclosingConstructor(Class klass);
 
   /**
* Returns the method which immediately encloses the specified class.  If
@@ -496,92 +496,18 @@
* is returned.
* @since 1.5
*/
-  static native Method getEnclosingMethod(Class? klass);
+  static native Method getEnclosingMethod(Class klass);
 
   /**
-   * p
-   * Returns an array of codeType/code objects which represent the
-   * interfaces directly implemented by the specified class or extended by the
-  

Re: [cp-patches] Patch: Scroll pane containing a JList with a preferred size.

2005-06-17 Thread Tom Tromey
 Lillian == Lillian Angel [EMAIL PROTECTED] writes:

A small formatting nit ...

Lillian +  if (p instanceof JScrollPane  !vd.equals( new Dimension() ))
Lillian +  ( (JScrollPane) p ).setPreferredSize( vd );

The spaces are in the wrong places here.  Should be:

if (p instanceof JScrollPane  !vd.equals (new Dimension()))
((JScrollPane) p).setPreferredSize(vd);

Tom


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


Re: [cp-patches] Patch: Scroll pane containing a JList with a preferred size.

2005-06-17 Thread Lillian Angel
On Fri, 2005-06-17 at 08:17 -0600, Tom Tromey wrote:
  Lillian == Lillian Angel [EMAIL PROTECTED] writes:
 
 A small formatting nit ...
 
 Lillian +if (p instanceof JScrollPane  !vd.equals( new 
 Dimension() ))
 Lillian +( (JScrollPane) p ).setPreferredSize( vd );
 
 The spaces are in the wrong places here.  Should be:
 
   if (p instanceof JScrollPane  !vd.equals (new Dimension()))
   ((JScrollPane) p).setPreferredSize(vd);
 
 Tom

Thanks! I'll be sure to do that correctly next time.

Lillian



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


[cp-patches] view in JScrollPane

2005-06-17 Thread Lillian Angel
With the new changes to JScrollPane, the view would not appear because
the viewport view was never initialized. I fixed this.

2005-06-17  Lillian Angel  [EMAIL PROTECTED]

   * javax/swing/JScrollPane.java
(JScrollPane): Viewport was not being set when 
the view was null. Whenever a view would be added to container   it
would not appear. This was changed to use setViewportView.

- Lillian. 
? a.diff
Index: ChangeLog
===
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.3863
diff -u -r1.3863 ChangeLog
--- ChangeLog   17 Jun 2005 11:53:50 -  1.3863
+++ ChangeLog   17 Jun 2005 14:16:55 -
@@ -1,3 +1,11 @@
+
+2005-06-17  Lillian Angel  [EMAIL PROTECTED]
+
+* javax/swing/JScrollPane.java
+   (JScrollPane): Viewport was not being set when 
+   the view was null. Whenever a view would be added to container it
+   would not appear. This was changed to use setViewportView.
+
 2005-06-17  Anthony Balkissoon  [EMAIL PROTECTED]
 
* javax/swing/JApplet.java,
@@ -235,6 +243,7 @@
(createDefaultDivider): Implemented new method. This creates
the Metal divider for JSplitPane.
 
+ 1.3863
 2005-06-13  Roman Kennke  [EMAIL PROTECTED]
 
* javax/swing/JSpinner.java
Index: javax/swing/JScrollPane.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollPane.java,v
retrieving revision 1.20
diff -u -r1.20 JScrollPane.java
--- javax/swing/JScrollPane.java14 Jun 2005 22:29:45 -  1.20
+++ javax/swing/JScrollPane.java17 Jun 2005 14:17:00 -
@@ -588,9 +588,7 @@
 setVerticalScrollBar(createVerticalScrollBar());
 setHorizontalScrollBarPolicy(hsbPolicy);
 setHorizontalScrollBar(createHorizontalScrollBar());
-viewport = createViewport();
-if (view != null)
-  viewport.setView(view);
+   setViewportView(view);
 setLayout(new ScrollPaneLayout());
 setOpaque(false);
 updateUI();
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] Re: [RFA/JDWP] Exceptions

2005-06-17 Thread Tom Tromey
 Keith == Keith Seitz [EMAIL PROTECTED] writes:

Keith Okay, this is another mean-spirited patch. It contains a bunch of
Keith exception types used by the JDWP back-end. Sadly, it does not contain
Keith all of them -- JDWP defines new errors for every little thing. The rest
Keith will be added as we go along.

This is ok, thanks.

Keith Unlike the last mega-patch I sent, I have put the most important class
Keith at the top of the patch (JdwpException), which is a base class for all
Keith the other files in the patch (which simply differ by constructor).

You've done a great job splitting up the changes and explaining them, btw.

Tom


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


[cp-patches] Patch: view in JScrollPane

2005-06-17 Thread Lillian Angel
I fixed the Patch in this attachment to not include the ChangeLog. Sorry
about that.

2005-06-17  Lillian Angel  [EMAIL PROTECTED]

   * javax/swing/JScrollPane.java
(JScrollPane): Viewport was not being set when 
the view was null. Whenever a view would be added to container
it would not appear. This was changed to use setViewportView.

- Lillian. 
? a.diff
Index: javax/swing/JScrollPane.java
===
RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollPane.java,v
retrieving revision 1.20
diff -u -r1.20 JScrollPane.java
--- javax/swing/JScrollPane.java14 Jun 2005 22:29:45 -  1.20
+++ javax/swing/JScrollPane.java17 Jun 2005 14:17:00 -
@@ -588,9 +588,7 @@
 setVerticalScrollBar(createVerticalScrollBar());
 setHorizontalScrollBarPolicy(hsbPolicy);
 setHorizontalScrollBar(createHorizontalScrollBar());
-viewport = createViewport();
-if (view != null)
-  viewport.setView(view);
+   setViewportView(view);
 setLayout(new ScrollPaneLayout());
 setOpaque(false);
 updateUI();
___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] Re: [RFA/JDWP] Exceptions

2005-06-17 Thread Keith Seitz
On Fri, 2005-06-17 at 08:29 -0600, Tom Tromey wrote:
  Keith == Keith Seitz [EMAIL PROTECTED] writes:
 
 Keith Okay, this is another mean-spirited patch. It contains a bunch of
 Keith exception types used by the JDWP back-end. Sadly, it does not contain
 Keith all of them -- JDWP defines new errors for every little thing. The rest
 Keith will be added as we go along.
 
 This is ok, thanks.

Done. Thanks.

Keith



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


[cp-patches] Re: [RFA/JDWP] ReferenceKey

2005-06-17 Thread Keith Seitz
On Fri, 2005-06-17 at 12:25 -0700, Keith Seitz wrote:

 ChangeLog
 2005-06-17  Keith Seitz  [EMAIL PROTECTED]
 
 * gnu/classpath/jdwp/id/ReferenceKey.java: New file.

Geez. I did it again...

Patch is attached this time. Really. It is. I promise.

Keith
Index: gnu/classpath/jdwp/id/ReferenceKey.java
===
RCS file: gnu/classpath/jdwp/id/ReferenceKey.java
diff -N gnu/classpath/jdwp/id/ReferenceKey.java
--- /dev/null   1 Jan 1970 00:00:00 -
+++ gnu/classpath/jdwp/id/ReferenceKey.java 17 Jun 2005 19:24:36 -
@@ -0,0 +1,130 @@
+/* ReferenceKey.java -- a SoftReference key type for Jdwp IDs
+   Copyright (C) 2005 Free Software Foundation
+
+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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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
+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 gnu.classpath.jdwp.id;
+
+import gnu.classpath.jdwp.exception.InvalidObjectException;
+
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+
+/**
+ * This class is a softreference type that is used by
+ * the ID manager as an index into a hash table.
+ */
+public class ReferenceKey extends SoftReference
+{
+  // Hash code of referent
+  private int _hash;
+
+  /**
+   * Constructs a new codeReferenceKey/code object
+   * with the given referent.
+   *
+   * pThis constructor should only be used for object lookups
+   * by the backend.
+   *
+   * @param referent  the object to reference
+   */
+  public ReferenceKey (Object referent)
+  {
+super (referent);
+_hash = referent.hashCode ();
+  }
+
+  /**
+   * Constructs a new codeReferenceKey/code object
+   * with the given referent and reference queue.
+   *
+   * pThe JDWP back-end stores a codeReferenceKey/code
+   * with its corresponding codeJdwpId/code. This constructor
+   * is used by the back-end when adding new IDs to be managed.
+   *
+   * @param referent  the object to reference
+   * @param queue the queue to which to report garbage collections
+   */
+  public ReferenceKey (Object referent, ReferenceQueue queue)
+  {
+super (referent, queue);
+_hash = referent.hashCode ();
+  }
+
+  /**
+   * Returns the hash code of the referent.
+   * This seems hacky, but is required in order to use this class
+   * as a hash table key.
+   *
+   * @returns the hash code of the referent
+   */
+  public int hashCode ()
+  {
+return _hash;
+  }
+
+  /**
+   * Comparator for keys
+   *
+   * This method can be used in two ways:
+   *
+   * ol
+   *liFor table lookups, where we want to compare referents/li
+   *liFor clearing GCd objects, where we want to compare the actual
+   *key object (not the referent)/li
+   * /ol
+  */
+  public boolean equals (Object obj)
+  {
+if (obj instanceof ReferenceKey)
+  {
+   ReferenceKey ref = (ReferenceKey) obj;
+
+   /* First check if the two references are the same.
+  If they are, that means we must be clearing GCd objects. */
+   if (this == obj)
+ return true;
+
+   // That failed, so we're looking for a matching Object
+   Object me = get ();
+   Object other = ref.get ();
+   return (me == null ? false : me.equals (other));
+  }
+
+return false;
+  }
+}
___
Classpath-patches mailing list

[cp-patches] [RFA/JDWP] ReferenceKey

2005-06-17 Thread Keith Seitz
Hi,

Okay, here'e where the weirdness starts. The ID manager (not yet
submitted) keeps a table which map objects to IDs. This is used to
quickly lookup Objects to see if they have an ID associated with them
already.

The ReferenceKey class is a SoftReference class with some logic to allow
the ID manager to clean-up garbage-collected Objects and their
ReferenceKeys.

After a patch for JdwpIdFactory, the IdManager is next.

Comments/questions/concerns?
Keith

ChangeLog
2005-06-17  Keith Seitz  [EMAIL PROTECTED]

* gnu/classpath/jdwp/id/ReferenceKey.java: New file.




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


[cp-patches] Patch: FYI: detect -encoding option for jikes

2005-06-17 Thread Tom Tromey
As noted a while ago, jikes does not have a '-encoding' option on
Windows.  This patch fixes the build so that we only use this option
where it is available.

Tom

Index: ChangeLog
from  Tom Tromey  [EMAIL PROTECTED]

* lib/Makefile.am (JAVAC): Use JIKESENCODING.
* m4/acinclude.m4 (CLASSPATH_CHECK_JIKES): Check for -encoding
option to jikes.
(JIKESENCODING): New subst.

Index: lib/Makefile.am
===
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.89
diff -u -r1.89 Makefile.am
--- lib/Makefile.am 14 Jun 2005 23:24:04 - 1.89
+++ lib/Makefile.am 17 Jun 2005 19:30:43 -
@@ -22,7 +22,7 @@
  $(GCJF) -C -d . @classes.standardx
 else
 if FOUND_JIKES
-JAVAC = $(JIKES) +Pno-shadow +Pno-switchcheck +F -encoding UTF-8 
-bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) 
-d . @classes
+JAVAC = $(JIKES) +Pno-shadow +Pno-switchcheck +F $(JIKESENCODING) 
-bootclasspath '' -extdirs '' -sourcepath '' --classpath $(compile_classpath) 
-d . @classes
 else
 if FOUND_KJC
 ## FIXME: from what I can tell, kjc does not support a -encoding option.
Index: m4/acinclude.m4
===
RCS file: /cvsroot/classpath/classpath/m4/acinclude.m4,v
retrieving revision 1.3
diff -u -r1.3 acinclude.m4
--- m4/acinclude.m4 14 Jun 2005 23:24:04 - 1.3
+++ m4/acinclude.m4 17 Jun 2005 19:30:44 -
@@ -157,6 +157,12 @@
 else
   AC_MSG_WARN($JIKES_VERSION: jikes 1.19 or higher required)
 fi
+
+JIKESENCODING=
+if test -n `$JIKES --help 21 | grep encoding`; then
+   JIKESENCODING='-encoding UTF-8'
+fi
+AC_SUBST(JIKESENCODING)
   fi
 ])
 


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


Re: [cp-patches] [RFA/JDWP] ReferenceKey

2005-06-17 Thread Archie Cobbs

Keith Seitz wrote:

Okay, here'e where the weirdness starts. The ID manager (not yet
submitted) keeps a table which map objects to IDs. This is used to
quickly lookup Objects to see if they have an ID associated with them
already.

The ReferenceKey class is a SoftReference class with some logic to allow
the ID manager to clean-up garbage-collected Objects and their
ReferenceKeys.


Coupla questions. Disclaimer: I haven't really been paying attention,
so ignore me if these are stupid irrelevant..

- Could java.util.WeakHashMap be used instead of writing your own?
  See java.lang.VMString.intern() for an example.

- Do you mean to use hashCode()/equals() or System.identityHashCode()/==?

-Archie

__
Archie Cobbs  *CTO, Awarix*  http://www.awarix.com


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


Re: [cp-patches] [RFA/JDWP] ReferenceKey

2005-06-17 Thread Keith Seitz
On Fri, 2005-06-17 at 14:47 -0500, Archie Cobbs wrote:
 Coupla questions. Disclaimer: I haven't really been paying attention,
 so ignore me if these are stupid irrelevant..

Nothing is irrelevant: I'm a Java newbie.

 - Could java.util.WeakHashMap be used instead of writing your own?
See java.lang.VMString.intern() for an example.

Yeah, that's a good question. Originally, I wrote this thing using a
Hashtable and SoftReferences, and the tables contained different
mappings of various things.

Now, however, the id manager has two tables for object types. One which
maps this ReferenceKey to its corresponding ObjectId (which contains a
SoftReference to the original object). The other is a table which maps
from a numerical ID to the ObjectId.

So, in fact, it does look like I could use a WeakHashMap to do this. I
presume their should be no problem in the value of the WeakHashMap
containing an object with a WeakReference to the Object, right? [Sorry,
all this strong, soft, weak, phantom, unreachable stuff is a little new
to me.]

 - Do you mean to use hashCode()/equals() or System.identityHashCode()/==?

WeakHashMap discussion aside, I needed to be able to compare two keys
for identity in two ways: one to match the Object and one to match
actual keys.

I think I just implemented some sort of hacky WeakHashMap!

I'll take a look changing to WeakHashMap to see what it does.

Thanks for the note!
Keith



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


[cp-patches] FYI: A single value CORBA 1.4 interfaces.

2005-06-17 Thread Meskauskas Audrius

2005-06-07  Audrius Meskauskas [EMAIL PROTECTED]

* org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.java, 
org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.java, 
org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.java, 
org/omg/PortableServer/LIFESPAN_POLICY_ID.java, 
org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.java, 
org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.java, 
org/omg/PortableServer/THREAD_POLICY_ID.java, 
org/omg/IOP/ENCODING_CDR_ENCAPS.java, 
org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.java, 
org/omg/IOP/TAG_CODE_SETS.java, 
org/omg/IOP/TAG_INTERNET_IOP.java, 
org/omg/IOP/TAG_JAVA_CODEBASE.java, 
org/omg/IOP/TAG_MULTIPLE_COMPONENTS.java, 
org/omg/IOP/TAG_ORB_TYPE.java, 
org/omg/IOP/TAG_POLICIES.java, 
org/omg/PortableInterceptor/LOCATION_FORWARD.java, 
org/omg/PortableInterceptor/SUCCESSFUL.java, 
org/omg/PortableInterceptor/SYSTEM_EXCEPTION.java, 
org/omg/PortableInterceptor/TRANSPORT_RETRY.java, 
org/omg/PortableInterceptor/USER_EXCEPTION.java: New files.


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