This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: classpath merging all over


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commted the attached patch to merge classpath with libgcj more 
again.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/EkIJWSOgCCdjSDsRAvNgAJ9dxw1RDx3ieqCsklFNeVedVtULrwCgg5Rg
cSIcTjKCpMNkW1GMa/h0qZI=
=QQnc
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2030
diff -u -b -B -r1.2030 ChangeLog
--- ChangeLog	13 Jul 2003 16:53:04 -0000	1.2030
+++ ChangeLog	14 Jul 2003 05:32:59 -0000
@@ -1,3 +1,19 @@
+2003-07-14  Michael Koch  <konqueror@gmx.de>
+
+	* java/awt/image/MemoryImageSource.java,
+	java/beans/PropertyEditorManager.java,
+	javax/naming/CompoundName.java,
+	javax/naming/spi/NamingManager.java,
+	javax/swing/AbstractButton.java,
+	javax/swing/ButtonModel.java,
+	javax/swing/SwingUtilities.java,
+	javax/swing/UIManager.java,
+	javax/swing/colorchooser/DefaultColorSelectionModel.java,
+	javax/swing/event/AncestorEvent.java,
+	javax/swing/event/InternalFrameEvent.java,
+	java/util/zip/ZipFile.java:
+	New versions from classpath.
+
 2003-07-13  Michael Koch  <konqueror@gmx.de>
 
 	* gnu/java/nio/FileChannelImpl.java,
Index: java/awt/image/MemoryImageSource.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/MemoryImageSource.java,v
retrieving revision 1.4
diff -u -b -B -r1.4 MemoryImageSource.java
--- java/awt/image/MemoryImageSource.java	9 Aug 2002 05:52:52 -0000	1.4
+++ java/awt/image/MemoryImageSource.java	14 Jul 2003 05:32:59 -0000
@@ -74,7 +74,7 @@
 	this.props = props;
 	int max = (( scansize > width ) ? scansize : width );
 	pixelb = new byte[ max  * height ];
-	System.arraycopy( pix, 0, pixelb, 0, max );
+	System.arraycopy( pix, 0, pixelb, 0, max * height );
     }
     /**
        Constructs an ImageProducer from memory
@@ -100,7 +100,7 @@
 	this.props = props;
 	int max = (( scansize > width ) ? scansize : width );
 	pixeli = new int[ max  * height ];
-	System.arraycopy( pix, 0, pixeli, 0, max );
+	System.arraycopy( pix, 0, pixeli, 0, max * height );
     }
     /**
        Constructs an ImageProducer from memory using the default RGB ColorModel
@@ -226,6 +226,7 @@
 	if( props != null ) {
 	    ic.setProperties( props );
 	}
+	ic.setDimensions(width, height);
 	if( pixeli != null ) {
 	    ic.setPixels( 0, 0, width, height, cm, pixeli, offset, scansize );
 	} else {
Index: java/beans/PropertyEditorManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/beans/PropertyEditorManager.java,v
retrieving revision 1.4
diff -u -b -B -r1.4 PropertyEditorManager.java
--- java/beans/PropertyEditorManager.java	17 Mar 2003 15:21:45 -0000	1.4
+++ java/beans/PropertyEditorManager.java	14 Jul 2003 05:33:01 -0000
@@ -140,9 +140,13 @@
             return (PropertyEditor)found.newInstance();
           }
 
+	ClassLoader contextClassLoader
+		= Thread.currentThread().getContextClassLoader();
+
         try
           {
-            found = Class.forName(editedClass.getName()+"Editor");
+            found = Class.forName(editedClass.getName()+"Editor", true,
+				  contextClassLoader);
             registerEditor(editedClass,found);
             return (PropertyEditor)found.newInstance();
           }
@@ -150,14 +154,18 @@
           {
           }
 
-        String appendName = "." + ClassHelper.getTruncatedClassName(editedClass) + "Editor";
+        String appendName
+		= "."
+		+ ClassHelper.getTruncatedClassName(editedClass)
+		+ "Editor";
         synchronized(editorSearchPath)
           {
             for(int i=0;i<editorSearchPath.length;i++)
               {
                 try
                   {
-                    found = Class.forName(editorSearchPath[i] + appendName);
+                    found = Class.forName(editorSearchPath[i] + appendName,
+					  true, contextClassLoader);
                     registerEditor(editedClass,found);
                     return (PropertyEditor)found.newInstance();
                   }
Index: javax/naming/CompoundName.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/naming/CompoundName.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 CompoundName.java
--- javax/naming/CompoundName.java	27 Jun 2003 13:06:50 -0000	1.3
+++ javax/naming/CompoundName.java	14 Jul 2003 05:33:01 -0000
@@ -142,13 +142,17 @@
 	    // Otherwise, fall through.
 	  }
 	// Quotes are only special at the start of a component.
-	else if (new_element.length () == 0 && special == beginQuote)
+	else if (new_element.length () == 0
+		 && special == beginQuote
+		 && beginQuote != null)
 	  {
 	    quote = endQuote;
 	    i += special.length ();
 	    continue;
 	  }
-	else if (new_element.length () == 0 && special == beginQuote2)
+	else if (new_element.length () == 0
+		 && special == beginQuote2
+		 && beginQuote2 != null)
 	  {
 	    quote = endQuote2;
 	    i += special.length ();
Index: javax/naming/spi/NamingManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/naming/spi/NamingManager.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 NamingManager.java
--- javax/naming/spi/NamingManager.java	30 Jun 2003 19:15:56 -0000	1.5
+++ javax/naming/spi/NamingManager.java	14 Jul 2003 05:33:01 -0000
@@ -83,12 +83,16 @@
 
 	try
 	  {
-	    icf = (InitialContextFactory) Class.forName (java_naming_factory_initial).newInstance ();
+	    icf = (InitialContextFactory)Class.forName
+		(java_naming_factory_initial, true,
+		 Thread.currentThread().getContextClassLoader())
+		.newInstance ();
 	  }
 	catch (Exception exception)
 	  {
 	    NoInitialContextException e
-	      = new NoInitialContextException ("Can't load InitialContextFactory class: "
+	      = new NoInitialContextException
+	      ("Can't load InitialContextFactory class: "
 					       + java_naming_factory_initial);
 	    e.setRootCause(exception);
 	    throw e;
Index: javax/swing/AbstractButton.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/AbstractButton.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 AbstractButton.java
--- javax/swing/AbstractButton.java	11 Jun 2003 13:20:39 -0000	1.2
+++ javax/swing/AbstractButton.java	14 Jul 2003 05:33:01 -0000
@@ -95,10 +94,6 @@
 		extends AccessibleJComponent 
 		implements AccessibleAction, AccessibleValue, AccessibleText {
 
-		//-------------------------------------------------------------
-		// Initialization ---------------------------------------------
-		//-------------------------------------------------------------
-
 		/**
 		 * Constructor AccessibleAbstractButton
 		 * @param component TODO
@@ -108,11 +103,6 @@
 			// TODO
 		} // AccessibleAbstractButton()
 
-
-		//-------------------------------------------------------------
-		// Methods ----------------------------------------------------
-		//-------------------------------------------------------------
-
 		/**
 		 * getAccessibleStateSet
 		 * @returns AccessibleStateSet
@@ -362,15 +352,6 @@
 		}
 	}
 
-
-	/**********************************************
-	 *
-	 * 
-	 *       Constructors
-	 *
-	 *
-	 ****************/
-
 	AbstractButton()
 	{
 		this("",null);
@@ -392,17 +373,9 @@
 		updateUI(); // get a proper ui
 	}
 
-
-	/**********************************************
-	 *
-	 * 
-	 *       Actions etc
-	 *
-	 *
-	 ****************/
-
 	public ButtonModel getModel()
 	{	return model;    }
+
 	public void setModel(ButtonModel newModel)
 	{	model = newModel;    }
 
@@ -435,13 +415,17 @@
 	public int getVerticalTextPosition()
 	{	return vert_text_pos;  }
 
-
 	protected  void fireItemStateChanged(ItemEvent event)
-	{    getModel().fireItemStateChanged(event);    }
+  {
+  }
+  
 	protected  void fireStateChanged(ChangeEvent event)
-	{	 getModel().fireStateChanged(event);    }
+  {
+  }
+  
 	protected void fireActionPerformed(ActionEvent event)
-	{	getModel().fireActionPerformed(event);    }
+  {
+  }
 
 	public void setVerticalAlignment(int alignment)
 	{	vert_align = alignment;    }
@@ -503,7 +495,7 @@
 		if (default_icon != null)
 		{
                   // XXX FIXME - icons do not know their parent
-//  			default_icon.setParent(this);
+        //  			default_icon.setParent(this);
 		}
 		revalidate();
 		repaint();
Index: javax/swing/ButtonModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/ButtonModel.java,v
retrieving revision 1.1
diff -u -b -B -r1.1 ButtonModel.java
--- javax/swing/ButtonModel.java	9 Aug 2002 04:26:10 -0000	1.1
+++ javax/swing/ButtonModel.java	14 Jul 2003 05:33:01 -0000
@@ -76,12 +76,4 @@
 
     void setSelected(boolean b);
     boolean isSelected();
-
-
-    // there are not in the spec !!
-
-
-    void fireItemStateChanged(ItemEvent event);
-    void fireStateChanged(ChangeEvent event);    
-    void fireActionPerformed(ActionEvent event);
 }
Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/SwingUtilities.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 SwingUtilities.java
--- javax/swing/SwingUtilities.java	19 Jun 2003 16:30:09 -0000	1.2
+++ javax/swing/SwingUtilities.java	14 Jul 2003 05:33:01 -0000
@@ -58,8 +58,8 @@
 public class SwingUtilities implements SwingConstants
 {
   public static FontMetrics getFontMetrics (Font font)
-{
-	return Toolkit.getDefaultToolkit().getFontMetrics(font);
+  {
+    return Toolkit.getDefaultToolkit ().getFontMetrics (font);
     }
 
   public static JRootPane getRootPane (Component a)
Index: javax/swing/UIManager.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/UIManager.java,v
retrieving revision 1.4
diff -u -b -B -r1.4 UIManager.java
--- javax/swing/UIManager.java	19 Jun 2003 10:48:44 -0000	1.4
+++ javax/swing/UIManager.java	14 Jul 2003 05:33:01 -0000
@@ -50,9 +50,7 @@
 
 public class UIManager implements Serializable
 {
-  static final long serialVersionUID = -5547433830339189365L;
-
-    static class LookAndFeelInfo
+  public static class LookAndFeelInfo
     {
 	String name, clazz;
 	
@@ -66,28 +65,42 @@
 	String getClassName() { return clazz; }
     }
 
+  private static final long serialVersionUID = -5547433830339189365L;
     
     static LookAndFeelInfo [] installed = {
-	new LookAndFeelInfo("Metal",
-			    "javax.swing.plaf.metal.MetalLookAndFeel")
+    new LookAndFeelInfo ("Metal", "javax.swing.plaf.metal.MetalLookAndFeel")
     };
 
-    
     static LookAndFeel[] aux_installed;
     
     static LookAndFeel look_and_feel  = new MetalLookAndFeel();
     
+  public UIManager()
+  {
+    // Do nothing here.
+  }
 
-    UIManager()
+  public static void addPropertyChangeListener (PropertyChangeListener listener)
     {
+    // FIXME
     }
 
-    public static  void addPropertyChangeListener(PropertyChangeListener listener)
+  public static void removePropertyChangeListener (PropertyChangeListener listener)
+    // Remove a PropertyChangeListener from the listener list. 
     {
-	//      Add a PropertyChangeListener to the listener list. 
+    // FIXME
     }
 
-    public static  void addAuxiliaryLookAndFeel(LookAndFeel l)
+  /**
+   * @since 1.4
+   */
+  public static PropertyChangeListener[] getPropertyChangeListeners ()
+  {
+    // FIXME
+    throw new Error ("Not implemented");
+  }
+
+  public static void addAuxiliaryLookAndFeel (LookAndFeel l)
     {
 	//          Add a LookAndFeel to the list of auxiliary look and feels. 
 	if (aux_installed == null)
@@ -98,9 +111,7 @@
 	    }
 	
 	LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ];
-	System.arraycopy(aux_installed, 0,
-			 T,             0,
-			 aux_installed.length);			 
+    System.arraycopy(aux_installed, 0, T, 0, aux_installed.length);			 
 	aux_installed = T;
 	aux_installed[aux_installed.length-1] = l;
     }
@@ -115,11 +126,8 @@
 		if (aux_installed[i] == laf)
 		    {
 			aux_installed[ i ] = aux_installed[aux_installed.length-1];
-			
 			LookAndFeel[] T = new LookAndFeel[ aux_installed.length-1 ];
-			System.arraycopy(aux_installed, 0,
-					 T,             0,
-					 aux_installed.length-1);			 
+            System.arraycopy (aux_installed, 0, T, 0, aux_installed.length-1);
 			aux_installed = T;
 			return true;
 		    }		
@@ -194,6 +200,7 @@
     {
 	return (Icon) getLookAndFeel().getDefaults().get(key);
     }
+  
     static  Insets getInsets(Object key)
     //      Returns an Insets object from the defaults table. 
     {
@@ -233,6 +239,7 @@
     {
 	return (String) getLookAndFeel().getDefaults().get(key);
     }
+  
     static  String getSystemLookAndFeelClassName()
     //      Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class. 
     {
@@ -262,14 +269,12 @@
     {
 	return getLookAndFeel().getDefaults().put(key,value);
     }
-    public static  void removePropertyChangeListener(PropertyChangeListener listener)
-    //      Remove a PropertyChangeListener from the listener list. 
-    {
-    }
+
     public static  void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
     //      Replaces the current array of installed LookAndFeelInfos. 
     {
     }
+  
     public static  void setLookAndFeel(LookAndFeel newLookAndFeel)
     {
 	if (look_and_feel != null)
@@ -279,14 +284,12 @@
 	look_and_feel = newLookAndFeel;
 	look_and_feel.initialize();
 	
-	//	revalidate();
-	//	repaint();
+    //revalidate();
+    //repaint();
     }
 
-    public static  void setLookAndFeel(String className)
-        throws ClassNotFoundException, 
-               InstantiationException, 
-               IllegalAccessException,
+  public static void setLookAndFeel (String className)
+    throws ClassNotFoundException, InstantiationException, IllegalAccessException,
 	       UnsupportedLookAndFeelException
     {
 	//          Set the current default look and feel using a class name.
Index: javax/swing/colorchooser/DefaultColorSelectionModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/colorchooser/DefaultColorSelectionModel.java,v
retrieving revision 1.3
diff -u -b -B -r1.3 DefaultColorSelectionModel.java
--- javax/swing/colorchooser/DefaultColorSelectionModel.java	11 Jun 2003 13:20:40 -0000	1.3
+++ javax/swing/colorchooser/DefaultColorSelectionModel.java	14 Jul 2003 05:33:01 -0000
@@ -52,90 +52,90 @@
 public class DefaultColorSelectionModel 
   implements ColorSelectionModel, Serializable
 {
-  static final long serialVersionUID = 580150227676302096L;
+  private static final long serialVersionUID = -8117143602864778804L;
 
-	//-------------------------------------------------------------
-	// Variables --------------------------------------------------
-	//-------------------------------------------------------------
-
-	/**
-	 * changeEvent
-	 */
-	protected transient ChangeEvent changeEvent;
+  private Color selectedColor;
 
-	/**
-	 * listenerList
-	 */
-	protected EventListenerList listenerList;
+  protected transient ChangeEvent changeEvent = new ChangeEvent (this);
+  protected EventListenerList listenerList = new EventListenerList ();
 
 	/**
-	 * selectedColor
+   * Creates a new color selection model.
 	 */
-	private Color selectedColor;
-
-
-	//-------------------------------------------------------------
-	// Initialization ---------------------------------------------
-	//-------------------------------------------------------------
+  public DefaultColorSelectionModel()
+  {
+    this (Color.white);
+  }
 
 	/**
-	 * Constructor DefaultColorSelectionModel
+   * Creates a new color selection model with a given selected color.
+   * 
+   * @param color The selected color.
 	 */
-	public DefaultColorSelectionModel() {
-		// TODO
-	} // DefaultColorSelectionModel()
+  public DefaultColorSelectionModel (Color color)
+  {
+    super();
+    this.selectedColor = color;
+  }
 
 	/**
-	 * Constructor DefaultColorSelectionModel
-	 * @param color TODO
+   * Returns the selected color.
+   * 
+   * @return The selected color.
 	 */
-	public DefaultColorSelectionModel(Color color) {
-		// TODO
-	} // DefaultColorSelectionModel()
-
-
-	//-------------------------------------------------------------
-	// Methods ----------------------------------------------------
-	//-------------------------------------------------------------
+  public Color getSelectedColor()
+  {
+    return selectedColor;
+  }
 
 	/**
-	 * getSelectedColor
-	 * @returns Color
+   * @param color The color to set.
 	 */
-	public Color getSelectedColor() {
-		return null; // TODO
-	} // getSelectedColor()
+  public void setSelectedColor (Color color)
+  {
+    this.selectedColor = color;
+  }
 
 	/**
-	 * setSelectedColor
-	 * @param color TODO
+   * Adds a listener to this model.
+   * 
+   * @param listener The listener to add.
 	 */
-	public void setSelectedColor(Color color) {
-		// TODO
-	} // setSelectedColor()
+  public void addChangeListener (ChangeListener listener)
+  {
+    listenerList.add (ChangeListener.class, listener);
+  }
 
 	/**
-	 * addChangeListener
-	 * @param listener TODO
+   * Removes a listener from this model.
+   * 
+   * @param listener The listener to remove.
 	 */
-	public void addChangeListener(ChangeListener listener) {
-		// TODO
-	} // addChangeListener()
+  public void removeChangeListener (ChangeListener listener)
+  {
+    listenerList.remove (ChangeListener.class, listener);
+  }
 
 	/**
-	 * removeChangeListener
-	 * @param listener TODO
+   * Returns all currently added <code>ChangeListener</code> objects.
+   *
+   * @return Array of <code>ChangeListener</code> objects.
 	 */
-	public void removeChangeListener(ChangeListener listener) {
-		// TODO
-	} // removeChangeListener()
+  public ChangeListener[] getChangeListeners()
+  {
+    return (ChangeListener[]) listenerList.getListeners (ChangeListener.class);
+  }
 
 	/**
-	 * fireStateChanged
+   * Calls all the <code>stateChanged()</code> method of all added
+   * <code>ChangeListener</code> objects with <code>changeEvent</code>
+   * as argument.
 	 */
-	protected void fireStateChanged() {
-		// TODO
-	} // fireStateChanged()
-
+  protected void fireStateChanged()
+  {
+    ChangeListener[] listeners = getChangeListeners();
 
-} // DefaultColorSelectionModel
+    for (int i = 0; i < listeners.length; i++)
+      listeners [i].stateChanged (changeEvent);
+  }
+}
Index: javax/swing/event/AncestorEvent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/event/AncestorEvent.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 AncestorEvent.java
--- javax/swing/event/AncestorEvent.java	27 Jun 2003 12:41:52 -0000	1.5
+++ javax/swing/event/AncestorEvent.java	14 Jul 2003 05:33:01 -0000
@@ -50,9 +50,9 @@
 {
   private static final long serialVersionUID = -8079801679695605002L;
   
-  public static final int ANCESTOR_ADDED = 0;
-  public static final int ANCESTOR_MOVED = 1;
+  public static final int ANCESTOR_ADDED = 1;
   public static final int ANCESTOR_REMOVED = 2;
+  public static final int ANCESTOR_MOVED = 3;
 
   private JComponent sourceComponent;
   private Container ancestor;
Index: javax/swing/event/InternalFrameEvent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/event/InternalFrameEvent.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 InternalFrameEvent.java
--- javax/swing/event/InternalFrameEvent.java	27 Jun 2003 12:41:52 -0000	1.5
+++ javax/swing/event/InternalFrameEvent.java	14 Jul 2003 05:33:01 -0000
@@ -81,7 +81,7 @@
   /**
    * Internal frame iconified event
    */
-  public static final int INTERNAL_FRAME_ICONIFIED = 2552;
+  public static final int INTERNAL_FRAME_ICONIFIED = 25552;
 
   /**
    * Internal frame last event
@@ -91,7 +91,7 @@
   /**
    * Internal frame opened event
    */
-  public static final int INTERNAL_FRAME_OPENED = 25550;
+  public static final int INTERNAL_FRAME_OPENED = 25549;
 
   /**
    * Creates a <code>JInternalFrameEvent</code> object.
Index: java/util/zip/ZipFile.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/ZipFile.java,v
retrieving revision 1.22
diff -u -b -B -r1.22 ZipFile.java
--- java/util/zip/ZipFile.java	17 Jun 2003 12:07:56 -0000	1.22
+++ java/util/zip/ZipFile.java	14 Jul 2003 05:33:01 -0000
@@ -308,7 +308,7 @@
    */
   protected void finalize() throws IOException
   {
-    if (!closed) close();
+    if (!closed && raf != null) close();
   }
 
   /**

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]