### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v retrieving revision 1.465 diff -u -r1.465 JavaModelManager.java --- model/org/eclipse/jdt/internal/core/JavaModelManager.java 14 Feb 2011 04:50:02 -0000 1.465 +++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 31 Mar 2011 19:09:44 -0000 @@ -2070,10 +2070,14 @@ // return cached options if already computed Hashtable cachedOptions; // use a local variable to avoid race condition (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=256329 ) - if ((cachedOptions = this.optionsCache) != null) return new Hashtable(cachedOptions); - + if ((cachedOptions = this.optionsCache) != null) { + if (DEBUG_302850) checkTaskTags("Retrieving options from optionsCache", this.optionsCache); //$NON-NLS-1$ + return new Hashtable(cachedOptions); + } + if (DEBUG_302850) System.out.println("optionsCache was null"); //$NON-NLS-1$ if (!Platform.isRunning()) { this.optionsCache = getDefaultOptionsNoInitialization(); + if (DEBUG_302850) checkTaskTags("Platform is not running", this.optionsCache); //$NON-NLS-1$ return new Hashtable(this.optionsCache); } // init @@ -2089,6 +2093,7 @@ options.put(propertyName, propertyValue); } } + if (DEBUG_302850) checkTaskTags("Options initialized from preferences", options); //$NON-NLS-1$ // get encoding through resource plugin options.put(JavaCore.CORE_ENCODING, JavaCore.getEncoding()); @@ -2107,13 +2112,30 @@ } Util.fixTaskTags(options); + if (DEBUG_302850) checkTaskTags("Retrieved options from preferences", options); //$NON-NLS-1$ // store built map in cache this.optionsCache = new Hashtable(options); + if (DEBUG_302850) checkTaskTags("Stored optionsCache", this.optionsCache); //$NON-NLS-1$ // return built map return options; } + // debugging bug 302850: + private void checkTaskTags(String msg, Hashtable someOptions) { + System.out.println(msg); + Object taskTags = someOptions.get(JavaCore.COMPILER_TASK_TAGS); + System.out.println(" + Task tags: " + taskTags); //$NON-NLS-1$ + if (taskTags == null) { + System.out.println(" - option names: "+this.optionNames); //$NON-NLS-1$ + System.out.println(" - Call stack:"); //$NON-NLS-1$ + StackTraceElement[] elements = new Exception().getStackTrace(); + for (int i=0,n=elements.length; i