Buggy code:
public abstract class JavaElement extends PlatformObject implements IJavaElement { public static final char JEM_JAVAPROJECT = '=' ; public static final char JEM_PACKAGEFRAGMENTROOT = Path . SEPARATOR ; public static final char JEM_PACKAGEFRAGMENT = '<' ; public static final char JEM_FIELD = '^' ; public static final char JEM_METHOD = '~' ; public static final char JEM_INITIALIZER = '|' ; public static final char JEM_COMPILATIONUNIT = '{' ; public static final char JEM_CLASSFILE = '(' ; public static final char JEM_TYPE = '[' ; public static final char JEM_PACKAGEDECLARATION = '%' ; public static final char JEM_IMPORTDECLARATION = '#' ; protected int fOccurrenceCount = 1 ; protected int fLEType = 0 ; protected IJavaElement fParent ; protected String fName ; protected static final Object NO_INFO = new Object ( ) ; protected JavaElement ( int type , IJavaElement parent , String name ) throws IllegalArgumentException { } public void close ( ) throws JavaModelException { } protected void closing ( Object info ) throws JavaModelException { } public boolean equals ( Object o ) { } protected boolean equalsDOMNode ( IDOMNode node ) throws JavaModelException { } public boolean exists ( ) { } public IDOMNode findNode ( IDOMCompilationUnit dom ) { } protected IDOMNode followPath ( ArrayList path , int position , IDOMNode node ) { } public IJavaElement getAncestor ( int ancestorType ) { } public IJavaElement [ ] getChildren ( ) throws JavaModelException { } public ArrayList getChildrenOfType ( int type ) throws JavaModelException { } public IClassFile getClassFile ( ) { } public ICompilationUnit getCompilationUnit ( ) { } public JavaElementInfo getElementInfo ( ) throws JavaModelException { } public String getElementName ( ) { } public int getElementType ( ) { } public String getHandleIdentifier ( ) { } public String getHandleMemento ( ) { } protected abstract char getHandleMementoDelimiter ( ) { } public IJavaModel getJavaModel ( ) { } public JavaModelManager getJavaModelManager ( ) { } public IJavaProject getJavaProject ( ) { } protected int getOccurrenceCount ( ) { } public IOpenable getOpenable ( ) { } public IOpenable getOpenableParent ( ) { } public IJavaElement getParent ( ) { } public Object getRawInfo ( ) throws JavaModelException { } protected IJavaElement getSourceElementAt ( int position ) throws JavaModelException { } public SourceMapper getSourceMapper ( ) { } public int hashCode ( ) { } protected boolean isAncestorOf ( IJavaElement e ) { } public boolean isReadOnly ( ) { } public boolean isStructureKnown ( ) throws JavaModelException { } protected JavaModelException newNotPresentException ( ) { } public void offsetSourceEndAndChildren ( int amount , IJavaElement child ) { } public void offsetSourceRange ( int amount ) { } protected void openHierarchy ( ) throws JavaModelException { } protected void opening ( Object info ) { } public String readableName ( ) { } protected void removeInfo ( ) { } public abstract IJavaElement rootedAt ( IJavaProject project ) { } protected void runOperation ( JavaModelOperation operation , IProgressMonitor monitor ) throws JavaModelException { try { if ( ( operation . isReadOnly ( ) ) || ( ResourcesPlugin . getWorkspace ( ) . isTreeLocked ( ) ) ) { operation . run ( monitor ) ; } else { <START_BUG> this . getJavaModel ( ) . getWorkspace ( ) . run ( operation , monitor ) ; <END_BUG> } } catch ( CoreException ce ) { if ( ce instanceof JavaModelException ) { throw ( ( JavaModelException ) ( ce ) ) ; } else { if ( ( ce . getStatus ( ) . getCode ( ) ) == ( IResourceStatus . OPERATION_FAILED ) ) { Throwable e = ce . getStatus ( ) . getException ( ) ; if ( e instanceof JavaModelException ) { throw ( ( JavaModelException ) ( e ) ) ; } } throw new JavaModelException ( ce ) ; } } } protected void setOccurrenceCount ( int count ) { } protected String tabString ( int tab ) { } public String toDebugString ( ) { } public String toString ( ) { } protected void toString ( int tab , StringBuffer buffer ) { } public String toStringWithAncestors ( ) { } protected void toStringAncestors ( StringBuffer buffer ) { } protected void toStringChildren ( int tab , StringBuffer buffer , Object info ) { } public Object toStringInfo ( int tab , StringBuffer buffer ) { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } public void triggerSourceEndOffset ( int amount , int nameStart , int nameEnd ) { } public void triggerSourceRangeOffset ( int amount , int nameStart , int nameEnd ) { } }

Fix:
ResourcesPlugin . getWorkspace ( ) . run ( operation , monitor ) ;