Buggy code:
public class NavigatorPane extends JPanel implements ItemListener , TreeSelectionListener { public static int MAX_HISTORY = 10 ; protected Vector _perspectives = new Vector ( ) ; protected ToolBar _toolbar = new ToolBar ( ) ; protected JComboBox _combo = new JComboBox ( ) ; protected Object _root = null ; protected Vector _navHistory = new Vector ( ) ; protected int _historyIndex = 0 ; protected NavPerspective _curPerspective = null ; protected DisplayTextTree _tree = new DisplayTextTree ( ) ; public static int _clicksInNavPane = 0 ; public static int _navPerspectivesChanged = 0 ; public NavigatorPane ( ) { } public void setRoot ( Object r ) { } public Object getRoot ( ) { } public Vector getPerspectives ( ) { } public void setPerspectives ( Vector pers ) { } public NavPerspective getCurPerspective ( ) { } public void setCurPerspective ( NavPerspective per ) { } public Object getSelectedObject ( ) { } public void forceUpdate ( ) { } public void setSelection ( Object level1 , Object level2 ) { } public Dimension getPreferredSize ( ) { } public Dimension getMinimumSize ( ) { } public void itemStateChanged ( ItemEvent e ) { } public void valueChanged ( TreeSelectionEvent e ) { } public void mySingleClick ( int row , TreePath path ) { } public void myDoubleClick ( int row , TreePath path ) { } public void navDown ( ) { } public void navUp ( ) { } public void clearHistory ( ) { } public void addToHistory ( Object sel ) { } public boolean canNavBack ( ) { } public void navBack ( ) { } public boolean canNavForw ( ) { } public void navForw ( ) { } protected void updateTree ( ) { } class NavigatorMouseListener extends MouseAdapter { public void mouseClicked ( MouseEvent me ) { } public void mousePressed ( MouseEvent me ) { Vector tailActions = new Vector ( ) ; if ( ( me . isPopupTrigger ( ) ) || ( ( me . getModifiers ( ) ) == ( InputEvent . BUTTON3_MASK ) ) ) { JPopupMenu popup = new JPopupMenu ( "test" ) ; Object obj = getSelectedObject ( ) ; if ( obj instanceof PopupGenerator ) { <START_BUG> Vector actions = ( ( PopupGenerator ) ( obj ) ) . getPopUpActions ( ) ; <END_BUG> int size = actions . size ( ) ; for ( int i = 0 ; i < size ; ++ i ) { AbstractAction a = ( ( AbstractAction ) ( actions . elementAt ( i ) ) ) ; popup . add ( a ) ; } } else if ( obj instanceof MMClass ) { popup . add ( new ActionGoToDetails ( "Properties" ) ) ; tailActions . addElement ( RemoveFromModel ) ; } else if ( obj instanceof UseCase ) { popup . add ( new ActionGoToDetails ( "Properties" ) ) ; tailActions . addElement ( RemoveFromModel ) ; } else if ( ( obj instanceof ModelElement ) || ( obj instanceof Diagram ) ) { popup . add ( new ActionGoToDetails ( "Properties" ) ) ; tailActions . addElement ( RemoveFromModel ) ; } int size = tailActions . size ( ) ; for ( int i = 0 ; i < size ; ++ i ) { AbstractAction a = ( ( AbstractAction ) ( tailActions . elementAt ( i ) ) ) ; popup . add ( a ) ; } popup . show ( NavigatorPane . this , me . getX ( ) , ( ( me . getY ( ) ) + 25 ) ) ; me . consume ( ) ; } } } class NavigatorKeyListener extends KeyAdapter { public void keyPressed ( KeyEvent e ) { } } }

Fix:
Vector actions = ( ( PopupGenerator ) ( obj ) ) . getPopUpActions ( me ) ;