diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/JFileChooser.java updated/classpath/javax/swing/JFileChooser.java
--- CVS/classpath/javax/swing/JFileChooser.java	2008-05-07 04:22:56.000000000 +0300
+++ updated/classpath/javax/swing/JFileChooser.java	2010-03-24 11:25:24.000000000 +0300
@@ -1,5 +1,5 @@
 /* JFileChooser.java --
-   Copyright (C) 2002, 2004, 2005, 2006,  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -615,15 +615,33 @@
    */
   public void setCurrentDirectory(File dir)
   {
-    if (currentDir != dir || dir == null)
-      {
-	if (dir == null)
-	  dir = fsv.getDefaultDirectory();
+    if (dir != null && !dir.exists())
+      return;
+
+    if (dir == null)
+      dir = fsv.getDefaultDirectory();
 
-	File old = currentDir;
-	currentDir = dir;
-	firePropertyChange(DIRECTORY_CHANGED_PROPERTY, old, currentDir);
+    if (dir != currentDir)
+      {
+        File prev = null;
+        while (!isTraversable(dir) && prev != dir)
+          {
+            prev = dir;
+            dir = getFileSystemView().getParentDirectory(dir);
+            if (dir == null)
+              {
+                dir = fsv.getDefaultDirectory();
+                break;
+              }
+          }
       }
+
+      if (!dir.equals(currentDir))
+        {
+          File old = currentDir;
+          currentDir = dir;
+          firePropertyChange(DIRECTORY_CHANGED_PROPERTY, old, currentDir);
+        }
   }
 
   /**
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/UIManager.java updated/classpath/javax/swing/UIManager.java
--- CVS/classpath/javax/swing/UIManager.java	2008-05-07 04:22:58.000000000 +0300
+++ updated/classpath/javax/swing/UIManager.java	2010-03-24 11:23:34.000000000 +0300
@@ -1,5 +1,6 @@
 /* UIManager.java -- 
-   Copyright (C) 2002, 2003, 2004, 2005, 2006,  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -212,20 +213,20 @@
   private static final long serialVersionUID = -5547433830339189365L;
 
   /** The installed look and feel(s). */
-  static LookAndFeelInfo [] installed = {
+  private static LookAndFeelInfo [] installed = {
     new LookAndFeelInfo("Metal", "javax.swing.plaf.metal.MetalLookAndFeel"),
     new LookAndFeelInfo("GNU", "gnu.javax.swing.plaf.gnu.GNULookAndFeel")
   };
 
   /** The installed auxiliary look and feels. */
-  static LookAndFeel[] auxLookAndFeels;
+  private static LookAndFeel[] auxLookAndFeels;
   
   /** The current look and feel. */
-  static LookAndFeel currentLookAndFeel;
+  private static LookAndFeel currentLookAndFeel;
   
-  static MultiplexUIDefaults currentUIDefaults;
+  private static MultiplexUIDefaults currentUIDefaults;
 
-  static UIDefaults lookAndFeelDefaults;
+  private static UIDefaults lookAndFeelDefaults;
 
   /** Property change listener mechanism. */
   static PropertyChangeSupport listeners
@@ -242,7 +243,7 @@
           }
         else
           {
-            setLookAndFeel(new MetalLookAndFeel());
+            setLookAndFeel(getCrossPlatformLookAndFeelClassName());
           }
       }
     catch (Exception ex)
@@ -882,6 +883,8 @@
    */
   public static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos)
   {
+    if (infos == null)
+      throw new NullPointerException();
     installed = infos;
   }
   
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/filechooser/FileSystemView.java updated/classpath/javax/swing/filechooser/FileSystemView.java
--- CVS/classpath/javax/swing/filechooser/FileSystemView.java	2006-10-16 14:27:36.000000000 +0300
+++ updated/classpath/javax/swing/filechooser/FileSystemView.java	2010-03-24 11:23:34.000000000 +0300
@@ -1,5 +1,5 @@
 /* FileSystemView.java --
-   Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2005, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -150,9 +150,11 @@
    */
   public File[] getFiles(File dir, boolean useFileHiding)
   {
-    if (dir == null || dir.listFiles() == null)
+    if (dir == null)
       return null;
     File[] files = dir.listFiles();
+    if (files == null)
+      return new File[0];
     if (! useFileHiding)
       return files;
     ArrayList trim = new ArrayList();
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java updated/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java
--- CVS/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java	2006-09-07 14:42:16.000000000 +0300
+++ updated/classpath/javax/swing/plaf/basic/BasicInternalFrameUI.java	2010-03-24 11:23:34.000000000 +0300
@@ -1,5 +1,5 @@
 /* BasicInternalFrameUI.java --
-   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -457,7 +457,7 @@
      */
     public void componentResized(ComponentEvent e)
     {
-      if (frame.isMaximum())
+      if (frame != null && frame.isMaximum())
         {
           Container parent = frame.getParent();
           Insets i = parent.getInsets();
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/plaf/basic/BasicToolBarUI.java updated/classpath/javax/swing/plaf/basic/BasicToolBarUI.java
--- CVS/classpath/javax/swing/plaf/basic/BasicToolBarUI.java	2006-09-18 02:05:50.000000000 +0300
+++ updated/classpath/javax/swing/plaf/basic/BasicToolBarUI.java	2010-03-24 11:27:02.000000000 +0300
@@ -1,5 +1,5 @@
 /* BasicToolBarUI.java --
-   Copyright (C) 2004, 2005, 2006  Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -468,13 +468,15 @@
       }
 
     Point p = dragWindow.getOffset();
-    Insets insets = toolBar.getInsets();
-
-    dragWindow.setBounds((origin.x + position.x) - p.x
-                         - ((insets.left + insets.right) / 2),
-                         (origin.y + position.y) - p.y
-                         - ((insets.top + insets.bottom) / 2), w, h);
+    if (p != null)
+      {
+        Insets insets = toolBar.getInsets();
 
+        dragWindow.setBounds((origin.x + position.x) - p.x
+                             - ((insets.left + insets.right) / 2),
+                             (origin.y + position.y) - p.y
+                             - ((insets.top + insets.bottom) / 2), w, h);
+      }
     if (! dragWindow.isVisible())
       dragWindow.show();
   }
@@ -550,10 +552,11 @@
     Insets insets = floatFrame.getInsets();
     Dimension dims = toolBar.getPreferredSize();
     p = dragWindow.getOffset();
-    setFloatingLocation((position.x + origin.x) - p.x
-                        - ((insets.left + insets.right) / 2),
-                        (position.y + origin.y) - p.y
-                        - ((insets.top + insets.bottom) / 2));
+    if (p != null)
+      setFloatingLocation((position.x + origin.x) - p.x
+                          - ((insets.left + insets.right) / 2),
+                          (position.y + origin.y) - p.y
+                          - ((insets.top + insets.bottom) / 2));
 
     if (aoc == -1)
       {
@@ -1212,7 +1215,7 @@
 
       isDragging = true;
 
-      if (dragWindow != null)
+      if (dragWindow != null && cachedBounds != null)
 	dragWindow.setOffset(new Point(cachedBounds.width / 2, 
             cachedBounds.height / 2));
 
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/plaf/basic/BasicTreeUI.java updated/classpath/javax/swing/plaf/basic/BasicTreeUI.java
--- CVS/classpath/javax/swing/plaf/basic/BasicTreeUI.java	2007-10-11 13:33:20.000000000 +0300
+++ updated/classpath/javax/swing/plaf/basic/BasicTreeUI.java	2010-03-24 11:23:34.000000000 +0300
@@ -1,5 +1,5 @@
 /* BasicTreeUI.java --
- Copyright (C) 2002, 2004, 2005, 2006, Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006, 2010  Free Software Foundation, Inc.
 
  This file is part of GNU Classpath.
 
@@ -2738,6 +2738,9 @@
         }
       else
         {
+          if (currentCellRenderer == null)
+            return null;
+
           // Not editing, ask renderer for preferred size.
           Component rend =
             currentCellRenderer.getTreeCellRendererComponent(tree, cell,
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/text/FieldView.java updated/classpath/javax/swing/text/FieldView.java
--- CVS/classpath/javax/swing/text/FieldView.java	2006-12-19 04:14:24.000000000 +0300
+++ updated/classpath/javax/swing/text/FieldView.java	2010-03-24 11:23:36.000000000 +0300
@@ -1,5 +1,5 @@
 /* FieldView.java -- 
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -80,7 +80,7 @@
    */ 
   private void checkContainer()
   {
-    Container c = getContainer();
+    final Container c = getContainer();
     
     if (c instanceof JTextField)
       {
@@ -90,7 +90,7 @@
         // (which is what the RI does).
         horizontalVisibility.addChangeListener(new ChangeListener(){
           public void stateChanged(ChangeEvent event) {
-            getContainer().repaint();
+            c.repaint();
           }
         });
 
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/tree/FixedHeightLayoutCache.java updated/classpath/javax/swing/tree/FixedHeightLayoutCache.java
--- CVS/classpath/javax/swing/tree/FixedHeightLayoutCache.java	2009-03-09 19:09:06.000000000 +0300
+++ updated/classpath/javax/swing/tree/FixedHeightLayoutCache.java	2010-03-24 11:23:36.000000000 +0300
@@ -1,5 +1,5 @@
 /* FixedHeightLayoutCache.java -- Fixed cell height tree layout cache
-Copyright (C) 2002, 2004, 2006,  Free Software Foundation, Inc.
+Copyright (C) 2002, 2004, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -350,6 +350,9 @@
           {
             Rectangle dim = getNodeDimensions(last, r.row, r.depth,
                                               r.isExpanded, rect);
+            if (dim == null)
+              return null;
+
             r.bounds = dim;
           }
 
diff -ru --ignore-tab-expansion CVS/classpath/javax/swing/tree/VariableHeightLayoutCache.java updated/classpath/javax/swing/tree/VariableHeightLayoutCache.java
--- CVS/classpath/javax/swing/tree/VariableHeightLayoutCache.java	2009-03-09 19:09:06.000000000 +0300
+++ updated/classpath/javax/swing/tree/VariableHeightLayoutCache.java	2010-03-24 11:28:52.000000000 +0300
@@ -1,5 +1,5 @@
 /* VariableHeightLayoutCache.java --
-   Copyright (C) 2002, 2004, 2006,  Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2006, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -252,11 +252,15 @@
       }
     NodeRecord nr = new NodeRecord(row, depth, node, parent);
     NodeDimensions d = getNodeDimensions();
-    Rectangle r = RECT_CACHE;
-    if (d != null)
-      r = d.getNodeDimensions(node, row, depth, nr.isExpanded, r);
-    else
-      r.setBounds(0, 0, 0, 0);
+
+    Rectangle r;
+    if (d == null ||
+        (r = d.getNodeDimensions(node, row, depth, nr.isExpanded,
+                                 RECT_CACHE)) == null)
+      {
+        r = RECT_CACHE;
+        r.setBounds(0, 0, 0, 0);
+      }
 
     if (! visible)
       r.y = -1;
