Re: [cp-patches] [RFA/JDWP] VMMethod
Tom Tromey wrote: "Keith" == Keith Seitz <[EMAIL PROTECTED]> writes: Keith> If someone could double-check the coding style/standard, I would Keith> appreciate it. I have not yet had any luck with running efj. Looks fine to me. Lacking any objections, I've committed this patch. Thanks for taking a peek, Tom. Keith
[cp-patches] FYI:Increasing reliability or getting the ID of virtual machine in java/rmi/server/UID
This patch tries to get the VM-specific code more reliably, adding the hash code of the local host string. 2006-03-08 Audrius Meskauskas <[EMAIL PROTECTED]> * java/rmi/server/UID.java (getMachineId): Include the host IP address. Index: UID.java === RCS file: /sources/classpath/classpath/java/rmi/server/UID.java,v retrieving revision 1.9 diff -u -r1.9 UID.java --- UID.java 8 Mar 2006 07:57:02 - 1.9 +++ UID.java 8 Mar 2006 21:38:24 - @@ -42,6 +42,7 @@ import java.io.DataOutput; import java.io.IOException; import java.io.Serializable; +import java.net.InetAddress; /** * Represents the unique identifier over time for the host which has generated @@ -187,10 +188,26 @@ */ static int getMachineId() { +int hostIpHash; + +try + { +// Try to get the host IP. +String host = InetAddress.getLocalHost().toString(); +// This hash is content - based, not the address based. +hostIpHash = host.hashCode(); + } +catch (Exception e) + { +// Failed due some reason. +hostIpHash = 0; + } + // Should be the unque address if hashcodes are addresses. // Additionally, add the time when the RMI system was probably started // (this class was first instantiated). -return UID.class.hashCode() + (int) System.currentTimeMillis(); +return new Object().hashCode() ^ (int) System.currentTimeMillis() + ^ hostIpHash; } /**
[cp-patches] FYI:Documenting and formatting java/rmi/server/ObjID.java
This class was not properly documented. 2006-03-08 Audrius Meskauskas <[EMAIL PROTECTED]> * java/rmi/server/ObjID.java: Documented and autoformatted. Index: ObjID.java === RCS file: /sources/classpath/classpath/java/rmi/server/ObjID.java,v retrieving revision 1.5 diff -u -r1.5 ObjID.java --- ObjID.java 2 Jul 2005 20:32:40 - 1.5 +++ ObjID.java 8 Mar 2006 21:18:35 - @@ -1,5 +1,6 @@ -/* ObjID.java -- - Copyright (c) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc. +/* ObjID.java -- Unique object id with respect to the given host. + Copyright (c) 1996, 1997, 1998, 1999, 2004, 2006 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,59 +46,138 @@ import java.io.ObjectOutput; import java.io.Serializable; -public final class ObjID implements Serializable +/** + * Represents the object identifier, unique for the host that generated it. + * The ObjID contains inside the integer object identifier that, if needed, + * may indicated that this is a reference to one of the well known objects + * on that host (registry, activator or dgc) and the [EMAIL PROTECTED] UID} that + * ensures uniqueness. + */ +public final class ObjID +implements Serializable { -static final long serialVersionUID = -6386392263968365220L; -private static long next = 0x8000L; -private static final Object lock = ObjID.class; - -public static final int REGISTRY_ID = 0; -public static final int ACTIVATOR_ID = 1; -public static final int DGC_ID = 2; - -private long objNum; -private UID space; - -public ObjID() { - synchronized (lock) { - objNum = next++; - } - space = new UID(); -} - -public ObjID(int num) { - objNum = (long)num; - space = new UID((short)0); -} - -public void write(ObjectOutput out) throws IOException { - DataOutput dout = (DataOutput)out; - dout.writeLong(objNum); - space.write(dout); -} - -public static ObjID read(ObjectInput in) throws IOException { - DataInput din = (DataInput)in; - ObjID id = new ObjID(); - id.objNum = din.readLong(); - id.space = UID.read(din); - return (id); -} - -public int hashCode() { - return ((int)objNum); -} - -public boolean equals(Object obj) { - if (obj instanceof ObjID && this.objNum == ((ObjID)obj).objNum) { - return (true); - } - return (false); -} - -public String toString() { - return ("[objNum: " + objNum + ", " + space + "]"); -} + /** + * Use serial version uid for interoperability. + */ + static final long serialVersionUID = - 6386392263968365220L; + + /** + * The object counter, which value is assigned when creating the ordinary + * objects without the known object id. The counter is incremented each time + * the new ObjID is constructed. + */ + private static long next = 0x8000L; + + /** + * The object to put the lock on when incrementing [EMAIL PROTECTED] #next} + */ + private static final Object lock = ObjID.class; + + /** + * Defines the ID of the naming service. + */ + public static final int REGISTRY_ID = 0; + + /** + * Defines the ID of the activator. + */ + public static final int ACTIVATOR_ID = 1; + + /** + * Defines the ID of the distributed garbage collector. + */ + public static final int DGC_ID = 2; + + /** + * The object Id (either well-known value or the value of the incrementing + * object counter. + */ + private long objNum; + + /** + * The object unique identifier, generated individually for each object. + */ + private UID space; + + /** + * Create the new object id, unique for this host. + */ + public ObjID() + { +synchronized (lock) + { +objNum = next++; + } +space = new UID(); + } + + /** + * Create the new object id defining the well known remotely accessible + * object, present in this host. The well - known objects are: + * + * [EMAIL PROTECTED] #REGISTRY_ID} - RMI naming service. + * [EMAIL PROTECTED] #ACTIVATOR_ID} - activator + * [EMAIL PROTECTED] #DGC_ID} - distributed garbage collector (grants lease + * durations to keep the object before it is garbage collected. + * + * + * @param id the well known object id, one of the above. + */ + public ObjID(int id) + { +objNum = (long) id; +space = new UID((short) 0); + } + + /** + * Write object id as long, then the object [EMAIL PROTECTED] UID}. + */ + public void write(ObjectOutput out) throws IOException + { +DataOutput dout = (DataOutput) out; +dout.writeLong(objNum); +space.write(dout); + } + + /** + * Read object id (as long), then the object [EMAIL PROTECTED] UID}. + */ + public static ObjID read(ObjectInput in) throws IOException + { +DataInput din = (DataInput) in; +ObjID id = new ObjID(); +id.objNum = din.readLong(); +id.space = UID.read(din); +return (id); + } + + /** + * Get the hashcode. + */ + public int hashCode() + { +return ((int) objNum); + } + + /** + * Comp
[cp-patches] FYI: Chages in tools build script (26584 fix).
This changes the build script so that only tools.zip and the single shared tools related README are installed. The source code is no longer installed. 2006-03-08 Audrius Meskauskas <[EMAIL PROTECTED]> PR 26584 * tools/Makefile.am (install-data-local, uninstall-local): Install/uninstall the tools/README only. * tools/gnu/classpath/tools/giop/README: Updated. * tools/README: New file. Index: Makefile.am === RCS file: /sources/classpath/classpath/tools/Makefile.am,v retrieving revision 1.5 diff -u -r1.5 Makefile.am --- Makefile.am 9 Feb 2006 23:10:42 - 1.5 +++ Makefile.am 8 Mar 2006 21:05:34 - @@ -56,25 +56,10 @@ # Make sure all sources and icons are also installed so users can use them. # (Be careful to strip off the srcdir part of the path when installing.) install-data-local: - srcdir_cnt=`echo $(srcdir) | wc -c`; \ - for file in $(ALL_TOOLS_FILES); do \ - f=`echo $$file | cut -c$$srcdir_cnt-`; \ - fdir=`dirname $$f`; \ - if test ! -d $(DESTDIR)$(pkgdatadir)/tools/$$fdir; then \ - echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir"; \ - $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir; \ - fi; \ - echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f; \ - done + cp $(srcdir)/README $(DESTDIR)$(pkgdatadir)/tools/README uninstall-local: - srcdir_cnt=`echo $(srcdir) | wc -c`; \ - for file in $(ALL_TOOLS_FILES); do \ - f=`echo $$file | cut -c$$srcdir_cnt-`; \ - echo "rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f"; \ - rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f; \ - done + rm $(DESTDIR)$(pkgdatadir)/tools/README # Make sure everything is included in the distribution. EXTRA_DIST = Makefile.am Index: gnu/classpath/tools/giop/README === RCS file: /sources/classpath/classpath/tools/gnu/classpath/tools/giop/README,v retrieving revision 1.3 diff -u -r1.3 README --- gnu/classpath/tools/giop/README 14 Feb 2006 15:36:22 - 1.3 +++ gnu/classpath/tools/giop/README 8 Mar 2006 21:05:34 - @@ -9,7 +9,8 @@ * GRMIC -RMI-IIOP stub and tie generator. * NameService - GIOP transient naming service (this tool is called tnameserv in Sun's package). -* NameService - GIOP persistent naming service (this tool is called +* NameServicePersistent + - GIOP persistent naming service (this tool is called orbd in Sun's package). * IorParser -Parses the stringified form of the interoperable object references (IOR's). Index: README === RCS file: README diff -N README --- /dev/null 1 Jan 1970 00:00:00 - +++ README 1 Jan 1970 00:00:00 - @@ -0,0 +1,44 @@ +The GNU Classpath tools are stored in the tools.zip. They can be invoked by +putting this archive into classpath and specifying the tool main class as the +class to run (parameters usually follow). The current release contains the +following tools: + +== GIOP tools == + +GIOP tools are used for creating the applications that use GIOP communication +protocol. It provides necessary support for org.omg.* and javax.rmi.* +packages. + +All GIOP tools support the --help option, for instance: + java -cp tools.zip gnu.classpath.tools.giop.IorParser --help + +The list of the currently available GIOP tools (name matches the main +class in gnu.classpath.tools.giop package): + +* GRMIC -RMI-IIOP stub and tie generator. +* NameService - GIOP transient naming service (this tool is called + tnameserv in Sun's package). +* NameServicePersistent + - GIOP persistent naming service (this tool is called + orbd in Sun's package). +* IorParser -Parses the stringified form of the interoperable + object references (IOR's). + +== RMI tools == + +RMI tools provide support for java.rmi package. All tools support +the --help key by printing more information, for instance: + java -cp tools.zip gnu.classpath.tools.rmi.RMIC --help + +The list of the currently available RMI tools (name matches the main tool class +in gnu.classpath.tools.rmi package): + +* RMIC - RMI stub and tie source code generator (complements + the ASM based bytecode generator in the separate + cp-tools project). This tool is only needed for + research and backward-compatibile applications, as + Classpath supports the 1.5 feature to replace such + stubs by proxy classes. + + +
Re: [cp-patches] Patch: GridBagLayout fix
There were more problems with GetLayoutInfo. After attempting to fix them, I realized it was because of the last component added to the layout. If the last component had a gridwidth == REMAINDER, it sets a variable (current_y) to be the starting point for the next component. Therefore, we should set y to current_y, not 0, in that case. 2006-03-08 Lillian Angel <[EMAIL PROTECTED]> * java/awt/GridBagLayout.java (GetLayoutInfo): If the last component added had gridwidth == REMAINDER, then the next item should be set to current_y (not 0). On Wed, 2006-03-08 at 13:22 -0500, Lillian Angel wrote: > A small GridBagLayout fix. Some components were not being placed at the > correct y-location. This should depend on the other components in the > row. They should be placed at the y-location of the row, if they are to > be placed last in a column. > > This fixes a layout issue in MegaMek. > > 2006-03-08 Lillian Angel <[EMAIL PROTECTED]> > > * java/awt/GridBagLayout.java > (GetLayoutInfo): If gridy is RELATIVE and there is no component > in the bottom-most spot of the column, we need to place that > component at the y-location of the other components in that > row. If there are no other components in that row, then place > it at y = 0. > Index: java/awt/GridBagLayout.java === RCS file: /sources/classpath/classpath/java/awt/GridBagLayout.java,v retrieving revision 1.24 diff -u -r1.24 GridBagLayout.java --- java/awt/GridBagLayout.java 8 Mar 2006 18:20:18 - 1.24 +++ java/awt/GridBagLayout.java 8 Mar 2006 20:01:18 - @@ -513,7 +513,6 @@ // // nothing to check; just add it - // cases 1 and 2 if(constraints.gridx == GridBagConstraints.RELATIVE) { @@ -558,14 +557,7 @@ // If this column is empty, add to the 0 position. if (!lastInCol.containsKey(new Integer(constraints.gridx))) { - if (lastInRow.containsKey(new Integer(constraints.gridx))) - { -Component lastComponent = (Component) lastInRow.get(new Integer(constraints.gridx)); -GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent); -y = lastConstraints.gridy; - } -else - y = 0; + y = current_y; } else {
[cp-patches] Patch: GridBagLayout fix
A small GridBagLayout fix. Some components were not being placed at the correct y-location. This should depend on the other components in the row. They should be placed at the y-location of the row, if they are to be placed last in a column. This fixes a layout issue in MegaMek. 2006-03-08 Lillian Angel <[EMAIL PROTECTED]> * java/awt/GridBagLayout.java (GetLayoutInfo): If gridy is RELATIVE and there is no component in the bottom-most spot of the column, we need to place that component at the y-location of the other components in that row. If there are no other components in that row, then place it at y = 0. Index: java/awt/GridBagLayout.java === RCS file: /sources/classpath/classpath/java/awt/GridBagLayout.java,v retrieving revision 1.23 diff -u -r1.23 GridBagLayout.java --- java/awt/GridBagLayout.java 6 Dec 2005 21:20:18 - 1.23 +++ java/awt/GridBagLayout.java 8 Mar 2006 18:15:38 - @@ -560,7 +557,16 @@ // this column. We want to add this component below it. // If this column is empty, add to the 0 position. if (!lastInCol.containsKey(new Integer(constraints.gridx))) -y = 0; +{ + if (lastInRow.containsKey(new Integer(constraints.gridx))) + { +Component lastComponent = (Component) lastInRow.get(new Integer(constraints.gridx)); +GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent); +y = lastConstraints.gridy; + } +else + y = 0; +} else { Component lastComponent = (Component)lastInCol.get(new Integer(constraints.gridx));
[cp-patches] FYI: ProgressMonitor/ProgressMonitorInputStream API doc updates
This patch (committed) adds some API docs to a couple of Swing classes: 2006-03-08 David Gilbert <[EMAIL PROTECTED]> * javax/swing/ProgressMonitor.java: Updated API docs, * javax/swing/ProgressMonitorInputStream.java: Likewise. Regards, Dave Index: javax/swing/ProgressMonitor.java === RCS file: /sources/classpath/classpath/javax/swing/ProgressMonitor.java,v retrieving revision 1.5 diff -u -r1.5 ProgressMonitor.java --- javax/swing/ProgressMonitor.java16 Sep 2005 19:08:14 - 1.5 +++ javax/swing/ProgressMonitor.java8 Mar 2006 16:43:33 - @@ -1,5 +1,5 @@ /* ProgressMonitor.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -100,10 +100,16 @@ boolean canceled; /** - * Constructor ProgressMonitor - * @param component The parent component of the progress dialog or null. - * @param message A constant message object which works in the way it does in JOptionPane. - * @param note A string message which can be changed while the operation goes on. + * Creates a new ProgressMonitor instance. This is used to + * monitor a task and pops up a dialog if the task is taking a long time to + * run. + * + * @param component The parent component of the progress dialog or + * null. + * @param message A constant message object which works in the way it does + *in [EMAIL PROTECTED] JOptionPane}. + * @param note A string message which can be changed while the operation goes + * on. * @param minimum The minimum value for the operation (start value). * @param maximum The maximum value for the operation (end value). */ @@ -178,9 +184,10 @@ } - /** Returns the minimum or start value of the operation. + /** + * Returns the minimum or start value of the operation. * - * @returns Minimum or start value of the operation. + * @return Minimum or start value of the operation. */ public int getMinimum() { @@ -207,7 +214,7 @@ /** * Return the maximum or end value of your operation. * - * @returns Maximum or end value. + * @return Maximum or end value. */ public int getMaximum() { @@ -228,7 +235,7 @@ /** * Returns whether the user canceled the operation. * - * @returns Whether the operation was canceled. + * @return Whether the operation was canceled. */ public boolean isCanceled() { @@ -243,7 +250,7 @@ * until the ProgressMonitor should decide whether * a progress dialog is to be shown or not. * - * @returns The duration in milliseconds. + * @return The duration in milliseconds. */ public int getMillisToDecideToPopup() { @@ -266,8 +273,12 @@ } /** - * getMillisToPopup - * @returns int + * Returns the number of milliseconds to wait before displaying the progress + * dialog. The default value is 2000. + * + * @return The number of milliseconds. + * + * @see #setMillisToPopup(int) */ public int getMillisToPopup() { @@ -275,8 +286,12 @@ } /** - * setMillisToPopup - * @param time TODO + * Sets the number of milliseconds to wait before displaying the progress + * dialog. + * + * @param time the number of milliseconds. + * + * @see #getMillisToPopup() */ public void setMillisToPopup(int time) { @@ -286,7 +301,7 @@ /** * Returns a message which is shown in the progress dialog. * - * @returns The changeable message visible in the progress dialog. + * @return The changeable message visible in the progress dialog. */ public String getNote() { @@ -313,7 +328,8 @@ } } - /** Internal method that creates the progress dialog. + /** + * Internal method that creates the progress dialog. */ void createDialog() { Index: javax/swing/ProgressMonitorInputStream.java === RCS file: /sources/classpath/classpath/javax/swing/ProgressMonitorInputStream.java,v retrieving revision 1.6 diff -u -r1.6 ProgressMonitorInputStream.java --- javax/swing/ProgressMonitorInputStream.java 16 Sep 2005 19:08:14 - 1.6 +++ javax/swing/ProgressMonitorInputStream.java 8 Mar 2006 16:43:33 - @@ -1,5 +1,5 @@ /* ProgressMonitorInputStream.java -- - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -46,7 +46,8 @@ import java.io.IOException; /** - * ProgressMonitorInputStream + * An input stream with a [EMAIL PROTECTED] ProgressMonitor}. + * * @author Andrew Selkirk * @author Robert Schuster ([EMAIL PROTECTED]) * @status updated to 1.2 @@ -56,7 +57,7 @@ { /** - * monitor + * The monitor watching
[cp-patches] RFC: add generated serialUID
Hi all, While playing with Eclipse and Classpath, I added some generated serialUID (warnings: 3586 -> 3543). Here is the changelog: 2006-03-08 Arnaud Vandyck <[EMAIL PROTECTED]> * examples/gnu/classpath/examples/awt/Demo.java, examples/gnu/classpath/examples/datatransfer/Demo.java, examples/gnu/classpath/examples/jawt/DemoJAWT.java, examples/gnu/classpath/examples/midi/Demo.java, examples/gnu/classpath/examples/swing/TextFieldDemo.java, examples/gnu/classpath/examples/swing/TextAreaDemo.java, examples/gnu/classpath/examples/swing/Demo.java, examples/gnu/classpath/examples/swing/TableDemo.java, examples/gnu/classpath/examples/swing/SpinnerDemo.java, examples/gnu/classpath/examples/swing/SliderDemo.java, examples/gnu/classpath/examples/swing/ScrollBarDemo.java, examples/gnu/classpath/examples/swing/ProgressBarDemo.java, examples/gnu/classpath/examples/swing/MiniDemo.java, examples/gnu/classpath/examples/swing/GNULookAndFeel.java, examples/gnu/classpath/examples/swing/FileChooserDemo.java, examples/gnu/classpath/examples/swing/ComboBoxDemo.java, examples/gnu/classpath/examples/swing/ButtonDemo.java: added generated (by Eclipse) serial version UID. Do I do this on other classes? -- Arnaud Vandyck ,= ,-_-. =. ((_/)o o(\_)) `-'(. .)`-' \_/ Java Trap: http://www.gnu.org/philosophy/java-trap.html Index: ChangeLog === RCS file: /sources/classpath/classpath/ChangeLog,v retrieving revision 1.6654 diff -u -r1.6654 ChangeLog --- ChangeLog 8 Mar 2006 08:06:18 - 1.6654 +++ ChangeLog 8 Mar 2006 12:43:21 - @@ -1,3 +1,24 @@ +2006-03-08 Arnaud Vandyck <[EMAIL PROTECTED]> + + * examples/gnu/classpath/examples/awt/Demo.java, + examples/gnu/classpath/examples/datatransfer/Demo.java, + examples/gnu/classpath/examples/jawt/DemoJAWT.java, + examples/gnu/classpath/examples/midi/Demo.java, + examples/gnu/classpath/examples/swing/TextFieldDemo.java, + examples/gnu/classpath/examples/swing/TextAreaDemo.java, + examples/gnu/classpath/examples/swing/Demo.java, + examples/gnu/classpath/examples/swing/TableDemo.java, + examples/gnu/classpath/examples/swing/SpinnerDemo.java, + examples/gnu/classpath/examples/swing/SliderDemo.java, + examples/gnu/classpath/examples/swing/ScrollBarDemo.java, + examples/gnu/classpath/examples/swing/ProgressBarDemo.java, + examples/gnu/classpath/examples/swing/MiniDemo.java, + examples/gnu/classpath/examples/swing/GNULookAndFeel.java, + examples/gnu/classpath/examples/swing/FileChooserDemo.java, + examples/gnu/classpath/examples/swing/ComboBoxDemo.java, + examples/gnu/classpath/examples/swing/ButtonDemo.java: + added generated (by Eclipse) serial version UID. + 2006-03-08 Michael Koch <[EMAIL PROTECTED]> * java/net/InetSocketAddress.java Index: gnu/classpath/examples/awt/Demo.java === RCS file: /sources/classpath/classpath/examples/gnu/classpath/examples/awt/Demo.java,v retrieving revision 1.4 diff -u -r1.4 Demo.java --- gnu/classpath/examples/awt/Demo.java 13 Jul 2005 23:22:30 - 1.4 +++ gnu/classpath/examples/awt/Demo.java 8 Mar 2006 12:41:49 - @@ -41,6 +41,8 @@ static class PrettyPanel extends Panel { +private static final long serialVersionUID = 3054931828195882771L; + Insets myInsets; public PrettyPanel () @@ -85,6 +87,8 @@ static class MainWindow extends PrettyFrame implements ActionListener { +private static final long serialVersionUID = - 5997452577015233740L; + Button closeButton; Hashtable windows; @@ -199,6 +203,8 @@ static class ButtonsWindow extends SubFrame implements ActionListener { +private static final long serialVersionUID = - 6924389825168515514L; + Button b[] = new Button [9]; public void init () @@ -257,6 +263,7 @@ static class DialogWindow extends Dialog implements SubWindow { +private static final long serialVersionUID = 4790577114506953621L; Label text; Frame parent; boolean initted = false; @@ -348,6 +355,7 @@ static class CursorsWindow extends SubFrame implements ItemListener { +private static final long serialVersionUID = 3710112649320693411L; Choice cursorChoice; Canvas cursorCanvas; @@ -375,7 +383,9 @@ cursorCanvas = new Canvas () { - public void paint (Graphics g) +private static final long serialVersionUID = - 4705111784504603742L; + +public void paint (Graphics g) { Dimension d = this.getSize(); g.setColor(Color.white); @@ -413,6 +423,7 @@ static class TextFieldWindow extends SubFrame implements ItemListener { +private static final long serialVersionUID = 3711337364602449661L; Checkbox editable, visible, sensitive; TextField text;
[cp-patches] [Patch] java.net.Proxy
Hello list, I commited the attached patch to fix some methods and a class variable to be final. Cheers, Michael 2006-03-08 Michael Koch <[EMAIL PROTECTED]> * java/net/Proxy.java (NO_PROXY): Made final. (equals): Likewise. (hashCode): Likewise. Index: java/net/Proxy.java === RCS file: /sources/classpath/classpath/java/net/Attic/Proxy.java,v retrieving revision 1.1.2.1 diff -u -r1.1.2.1 Proxy.java --- java/net/Proxy.java 7 Mar 2006 13:12:33 - 1.1.2.1 +++ java/net/Proxy.java 8 Mar 2006 12:01:18 - @@ -51,7 +51,7 @@ */ public enum Type { DIRECT, HTTP, SOCKS }; - public static Proxy NO_PROXY = new Proxy(Type.DIRECT, null); + public static final Proxy NO_PROXY = new Proxy(Type.DIRECT, null); private Type type; private SocketAddress address; @@ -96,7 +96,7 @@ * @return true if both objects or equals, * false otherwise. */ - public boolean equals(Object obj) + public final boolean equals(Object obj) { if (! (obj instanceof Proxy)) return false; @@ -112,7 +112,7 @@ * * @return the hashcode */ - public int hashCode() + public final int hashCode() { return type.hashCode() ^ address.hashCode(); }
[cp-patches] [Patch] InetSocketAddress.createUnresolved()
Hello list, I commited the attached patch to introduce a new method from 1.5. I backed it up by a new mauve testcase which I will commit soon. Cheers, Michael 2006-03-08 Michael Koch <[EMAIL PROTECTED]> * java/net/InetSocketAddress.java (InetSocketAddress(String,int,resolve)): New private contructor. (InetSocketAddress(String,int)): Use new private constructor. (createUnresolved): New method. Index: java/net/InetSocketAddress.java === RCS file: /sources/classpath/classpath/java/net/InetSocketAddress.java,v retrieving revision 1.12 diff -u -r1.12 InetSocketAddress.java --- java/net/InetSocketAddress.java 14 Sep 2005 17:06:27 - 1.12 +++ java/net/InetSocketAddress.java 8 Mar 2006 08:05:48 - @@ -1,5 +1,5 @@ /* InetSocketAddress.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -107,10 +107,26 @@ * @param hostname The hostname for the socket address * @param port The port for the socket address * - * @exception IllegalArgumentException If the port number is illegal + * @exception IllegalArgumentException If the port number is illegal or + * the hostname argument is null */ public InetSocketAddress(String hostname, int port) -throws IllegalArgumentException + { +this(hostname, port, true); + } + + /** + * Constructs an InetSocketAddress instance. + * + * @param hostname The hostname for the socket address + * @param port The port for the socket address + * @param resolve true if the address has to be resolved, + * false otherwise + * + * @exception IllegalArgumentException If the port number is illegal or + * the hostname argument is null + */ + private InetSocketAddress(String hostname, int port, boolean resolve) { if (hostname == null) throw new IllegalArgumentException("Null host name value"); @@ -120,15 +136,36 @@ this.port = port; this.hostname = hostname; +this.addr = null; -try - { - this.addr = InetAddress.getByName(hostname); - } -catch (Exception e) // UnknownHostException, SecurityException - { - this.addr = null; - } +if (resolve) +{ + try +{ + this.addr = InetAddress.getByName(hostname); +} + catch (Exception e) // UnknownHostException, SecurityException +{ + // Do nothing here. this.addr is already set to null. +} +} + + } + + /** + * Creates an unresolved InetSocketAddress object. + * + * @param hostname The hostname for the socket address + * @param port The port for the socket address + * + * @exception IllegalArgumentException If the port number is illegal or + * the hostname argument is null + * + * @since 1.5 + */ + public static InetSocketAddress createUnresolved(String hostname, int port) + { +return new InetSocketAddress(hostname, port, false); } /**
[cp-patches] FYI: java/rmi/server/UID.java constructor fix
2006-03-07 Audrius Meskauskas <[EMAIL PROTECTED]> * java/rmi/server/UID.java (constructor): Assing last and time fields after pause. Index: UID.java === RCS file: /sources/classpath/classpath/java/rmi/server/UID.java,v retrieving revision 1.8 diff -u -r1.8 UID.java --- UID.java 7 Mar 2006 20:04:29 - 1.8 +++ UID.java 8 Mar 2006 07:52:44 - @@ -123,6 +123,7 @@ { } uidCounter = Short.MIN_VALUE; +time = last = System.currentTimeMillis(); } count = uidCounter++;