Buggy code:
public class ActionSaveGraphics extends UMLAction { protected static Category cat = Category . getInstance ( ActionSaveGraphics . class ) ; public static ActionSaveGraphics SINGLETON = new ActionSaveGraphics ( ) ; public static final String separator = "//" ; protected ActionSaveGraphics ( ) { } public void actionPerformed ( ActionEvent ae ) { } public boolean trySave ( boolean overwrite ) { Object target = TheInstance . getActiveDiagram ( ) ; if ( target instanceof Diagram ) { String defaultName = ( ( Diagram ) ( target ) ) . getName ( ) ; defaultName = Util . stripJunk ( defaultName ) ; ProjectBrowser pb = ProjectBrowser . TheInstance ; <START_BUG> Project p = pb . getProject ( ) ; <END_BUG> try { JFileChooser chooser = null ; try { if ( ( ( p != null ) && ( ( p . getURL ( ) ) != null ) ) && ( ( p . getURL ( ) . getFile ( ) . length ( ) ) > 0 ) ) { String filename = p . getURL ( ) . getFile ( ) ; if ( ! ( filename . startsWith ( "//FILE1//+//" ) ) ) chooser = OsUtil . getFileChooser ( p . getURL ( ) . getFile ( ) ) ; } } catch ( Exception ex ) { ActionSaveGraphics . cat . error ( "exception<seq2seq4repair_space>in<seq2seq4repair_space>opening<seq2seq4repair_space>JFileChooser" , ex ) ; } if ( chooser == null ) chooser = OsUtil . getFileChooser ( ) ; chooser . setDialogTitle ( ( "Save<seq2seq4repair_space>Diagram<seq2seq4repair_space>as<seq2seq4repair_space>Graphics:<seq2seq4repair_space>" + defaultName ) ) ; chooser . setAcceptAllFileFilterUsed ( false ) ; chooser . addChoosableFileFilter ( GIFFilter ) ; chooser . addChoosableFileFilter ( PSFilter ) ; chooser . addChoosableFileFilter ( EPSFilter ) ; chooser . addChoosableFileFilter ( SVGFilter ) ; chooser . setFileFilter ( GIFFilter ) ; File def = new File ( ( ( defaultName + "." ) + ( GIFFilter . _suffix ) ) ) ; chooser . setSelectedFile ( def ) ; int retval = chooser . showSaveDialog ( pb ) ; if ( retval == 0 ) { File theFile = chooser . getSelectedFile ( ) ; if ( theFile != null ) { String path = theFile . getParent ( ) ; String name = theFile . getName ( ) ; String extension = SuffixFilter . getExtension ( theFile ) ; if ( ( extension == null ) || ( ! ( ( ( ( extension . equals ( _suffix ) ) || ( extension . equals ( FileFilters . EPSFilter . _suffix ) ) ) || ( extension . equals ( FileFilters . GIFFilter . _suffix ) ) ) || ( extension . equals ( FileFilters . SVGFilter . _suffix ) ) ) ) ) { FileFilter filter = ( ( FileFilter ) ( chooser . getFileFilter ( ) ) ) ; extension = FileFilters . getSuffix ( filter ) ; theFile = new File ( theFile . getParentFile ( ) , ( ( ( theFile . getName ( ) ) + "." ) + extension ) ) ; } CmdSaveGraphics cmd = null ; if ( _suffix . equals ( extension ) ) cmd = new CmdSavePS ( ) ; else if ( FileFilters . EPSFilter . _suffix . equals ( extension ) ) cmd = new CmdSaveEPS ( ) ; else if ( FileFilters . GIFFilter . _suffix . equals ( extension ) ) cmd = new CmdSaveGIF ( ) ; else if ( FileFilters . SVGFilter . _suffix . equals ( extension ) ) cmd = new CmdSaveSVG ( ) ; else { pb . showStatus ( ( "Unknown<seq2seq4repair_space>graphics<seq2seq4repair_space>file<seq2seq4repair_space>type<seq2seq4repair_space>withextension<seq2seq4repair_space>" + extension ) ) ; return false ; } if ( ! ( path . endsWith ( ActionSaveGraphics . separator ) ) ) path += ActionSaveGraphics . separator ; pb . showStatus ( ( ( ( "Writing<seq2seq4repair_space>" + path ) + name ) + "..." ) ) ; if ( ( theFile . exists ( ) ) && ( ! overwrite ) ) { String t = ( "Overwrite<seq2seq4repair_space>" + path ) + name ; int response = JOptionPane . showConfirmDialog ( pb , t , t , JOptionPane . YES_NO_OPTION ) ; if ( response == ( JOptionPane . NO_OPTION ) ) return false ; } FileOutputStream fo = new FileOutputStream ( theFile ) ; cmd . setStream ( fo ) ; cmd . doIt ( ) ; fo . close ( ) ; pb . showStatus ( ( ( "Wrote<seq2seq4repair_space>" + path ) + name ) ) ; return true ; } } } catch ( FileNotFoundException ignore ) { ActionSaveGraphics . cat . error ( "got<seq2seq4repair_space>a<seq2seq4repair_space>FileNotFoundException" , ignore ) ; } catch ( IOException ignore ) { ActionSaveGraphics . cat . error ( "got<seq2seq4repair_space>an<seq2seq4repair_space>IOException" , ignore ) ; } } return false ; } }

Fix:
Project p = ProjectManager . getManager ( ) . getCurrentProject ( ) ;