View | Details | Raw Unified | Return to bug 138599 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/core/IJavaModelStatusConstants.java (+12 lines)
Lines 320-323 Link Here
320
	 * @since 3.2
320
	 * @since 3.2
321
	 */
321
	 */
322
	public static final int UNKNOWN_JAVADOC_FORMAT = 1009;
322
	public static final int UNKNOWN_JAVADOC_FORMAT = 1009;
323
	/**
324
	 * <p>Status constant indicating that the variable is deprecated.</p>
325
	 * 
326
	 * @since 3.3
327
	 */
328
	public static final int DEPRECATED_VARIABLE = 1010;
329
	/**
330
	 * <p>Status constant indicating that the variable is read-only.</p>
331
	 * 
332
	 * @since 3.3
333
	 */
334
	public static final int READ_ONLY_VARIABLE = 1011;
323
}
335
}
(-)model/org/eclipse/jdt/core/IClasspathEntry.java (-37 / +37 lines)
Lines 15-21 Link Here
15
/** 
15
/** 
16
 * An entry on a Java project classpath identifying one or more package fragment
16
 * An entry on a Java project classpath identifying one or more package fragment
17
 * roots. A classpath entry has a content kind (either source, 
17
 * roots. A classpath entry has a content kind (either source, 
18
 * <code>K_SOURCE</code>, or binary, <code>K_BINARY</code>), which is inherited
18
 * {@link IPackageFragmentRoot#K_SOURCE}, or binary, {@link IPackageFragmentRoot#K_BINARY}), which is inherited
19
 * by each package fragment root and package fragment associated with the entry.
19
 * by each package fragment root and package fragment associated with the entry.
20
 * <p>
20
 * <p>
21
 * A classpath entry can refer to any of the following:<ul>
21
 * A classpath entry can refer to any of the following:<ul>
Lines 29-35 Link Here
29
 *		represent compilation units. All compilation units will be compiled when
29
 *		represent compilation units. All compilation units will be compiled when
30
 * 		the project is built. The classpath entry must specify the
30
 * 		the project is built. The classpath entry must specify the
31
 *		absolute path to the root folder. Entries of this kind are 
31
 *		absolute path to the root folder. Entries of this kind are 
32
 *		associated with the <code>CPE_SOURCE</code> constant.
32
 *		associated with the {@link #CPE_SOURCE} constant.
33
 *      Source classpath entries can carry inclusion and exclusion patterns for
33
 *      Source classpath entries can carry inclusion and exclusion patterns for
34
 *      selecting which source files appear as compilation
34
 *      selecting which source files appear as compilation
35
 *      units and get compiled when the project is built.
35
 *      units and get compiled when the project is built.
Lines 40-46 Link Here
40
 *		package fragments and <code>.class</code> files.  The classpath entry
40
 *		package fragments and <code>.class</code> files.  The classpath entry
41
 *		must specify the absolute path to the JAR (or root folder), and in case it refers
41
 *		must specify the absolute path to the JAR (or root folder), and in case it refers
42
 *		to an external JAR, then there is no associated resource in the workbench. Entries 
42
 *		to an external JAR, then there is no associated resource in the workbench. Entries 
43
 *		of this kind are associated with the <code>CPE_LIBRARY</code> constant.</li>
43
 *		of this kind are associated with the {@link #CPE_LIBRARY} constant.</li>
44
 * 
44
 * 
45
 *	<li>A required project. In this case the entry identifies another project in
45
 *	<li>A required project. In this case the entry identifies another project in
46
 *		the workspace. The required project is used as a binary library when compiling
46
 *		the workspace. The required project is used as a binary library when compiling
Lines 51-100 Link Here
51
 *		is performed against a required project's source code, and compilation is 
51
 *		is performed against a required project's source code, and compilation is 
52
 *		performed against a required project's last built state.  The
52
 *		performed against a required project's last built state.  The
53
 *		classpath entry must specify the absolute path to the
53
 *		classpath entry must specify the absolute path to the
54
 *		project. Entries of this kind are  associated with the <code>CPE_PROJECT</code>
54
 *		project. Entries of this kind are  associated with the {@link #CPE_PROJECT}
55
 *		constant. 
55
 *		constant. 
56
 * 		Note: referencing a required project with a classpath entry refers to the source 
56
 * 		Note: referencing a required project with a classpath entry refers to the source 
57
 *     code or associated <code>.class</code> files located in its output location. 
57
 *     code or associated <code>.class</code> files located in its output location. 
58
 *     It will also automatically include any other libraries or projects that the required project's classpath 
58
 *     It will also automatically include any other libraries or projects that the required project's classpath 
59
 *     refers to, iff the corresponding classpath entries are tagged as being exported 
59
 *     refers to, iff the corresponding classpath entries are tagged as being exported 
60
 *     (<code>IClasspathEntry#isExported</code>). 
60
 *     ({@link IClasspathEntry#isExported}). 
61
 *    Unless exporting some classpath entries, classpaths are not chained by default - 
61
 *    Unless exporting some classpath entries, classpaths are not chained by default - 
62
 *    each project must specify its own classpath in its entirety.</li>
62
 *    each project must specify its own classpath in its entirety.</li>
63
 * 
63
 * 
64
 *  <li> A path beginning in a classpath variable defined globally to the workspace.
64
 *  <li> A path beginning in a classpath variable defined globally to the workspace.
65
 *		Entries of this kind are  associated with the <code>CPE_VARIABLE</code> constant.  
65
 *		Entries of this kind are  associated with the {@link #CPE_VARIABLE} constant.  
66
 *      Classpath variables are created using <code>JavaCore#setClasspathVariable</code>,
66
 *      Classpath variables are created using {@link JavaCore#setClasspathVariable(String, IPath, org.eclipse.core.runtime.IProgressMonitor)},
67
 * 		and gets resolved, to either a project or library entry, using
67
 * 		and gets resolved, to either a project or library entry, using
68
 *      <code>JavaCore#getResolvedClasspathVariable</code>.
68
 *      {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)}.
69
 *		It is also possible to register an automatic initializer (<code>ClasspathVariableInitializer</code>),
69
 *		It is also possible to register an automatic initializer ({@link ClasspathVariableInitializer}),
70
 * 	which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer".
70
 * 	which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer".
71
 * 	After resolution, a classpath variable entry may either correspond to a project or a library entry. </li>
71
 * 	After resolution, a classpath variable entry may either correspond to a project or a library entry. </li>
72
 * 
72
 * 
73
 *  <li> A named classpath container identified by its container path.
73
 *  <li> A named classpath container identified by its container path.
74
 *     A classpath container provides a way to indirectly reference a set of classpath entries through
74
 *     A classpath container provides a way to indirectly reference a set of classpath entries through
75
 *     a classpath entry of kind <code>CPE_CONTAINER</code>. Typically, a classpath container can
75
 *     a classpath entry of kind {@link #CPE_CONTAINER}. Typically, a classpath container can
76
 *     be used to describe a complex library composed of multiple JARs, projects or classpath variables,
76
 *     be used to describe a complex library composed of multiple JARs, projects or classpath variables,
77
 *     considering also that containers can be mapped differently on each project. Several projects can
77
 *     considering also that containers can be mapped differently on each project. Several projects can
78
 *     reference the same generic container path, but have each of them actually bound to a different
78
 *     reference the same generic container path, but have each of them actually bound to a different
79
 *     container object.
79
 *     container object.
80
 *     The container path is a formed by a first ID segment followed with extra segments, 
80
 *     The container path is a formed by a first ID segment followed with extra segments, 
81
 *     which can be used as additional hints for resolving this container reference. If no container was ever 
81
 *     which can be used as additional hints for resolving this container reference. If no container was ever 
82
 *     recorded for this container path onto this project (using <code>setClasspathContainer</code>, 
82
 *     recorded for this container path onto this project (using {@link JavaCore#setClasspathContainer}, 
83
 * 	then a <code>ClasspathContainerInitializer</code> will be activated if any was registered for this 
83
 * 	then a {@link ClasspathContainerInitializer} will be activated if any was registered for this 
84
 * 	container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer".
84
 * 	container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer".
85
 * 	A classpath container entry can be resolved explicitly using <code>JavaCore#getClasspathContainer</code>
85
 * 	A classpath container entry can be resolved explicitly using {@link JavaCore#getClasspathContainer}
86
 * 	and the resulting container entries can contain any non-container entry. In particular, it may contain variable
86
 * 	and the resulting container entries can contain any non-container entry. In particular, it may contain variable
87
 *     entries, which in turn needs to be resolved before being directly used. 
87
 *     entries, which in turn needs to be resolved before being directly used. 
88
 * 	<br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same
88
 * 	<br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same
89
 * 	container path to be interpreted in different ways for different projects. </li>
89
 * 	container path to be interpreted in different ways for different projects. </li>
90
 * </ul>
90
 * </ul>
91
 * </p>
91
 * </p>
92
 * The result of <code>IJavaProject#getResolvedClasspath</code> will have all entries of type
92
 * The result of {@link IJavaProject#getResolvedClasspath} will have all entries of type
93
 * <code>CPE_VARIABLE</code> and <code>CPE_CONTAINER</code> resolved to a set of 
93
 * {@link #CPE_VARIABLE} and {@link #CPE_CONTAINER} resolved to a set of 
94
 * <code>CPE_SOURCE</code>, <code>CPE_LIBRARY</code> or <code>CPE_PROJECT</code>
94
 * {@link #CPE_SOURCE}, {@link #CPE_LIBRARY} or {@link #CPE_PROJECT}
95
 * classpath entries.
95
 * classpath entries.
96
 * <p>
96
 * <p>
97
 * Any classpath entry other than a source folder (kind <code>CPE_SOURCE</code>) can
97
 * Any classpath entry other than a source folder (kind {@link #CPE_SOURCE}) can
98
 * be marked as being exported. Exported entries are automatically contributed to
98
 * be marked as being exported. Exported entries are automatically contributed to
99
 * dependent projects, along with the project's default output folder, which is
99
 * dependent projects, along with the project's default output folder, which is
100
 * implicitly exported, and any auxiliary output folders specified on source
100
 * implicitly exported, and any auxiliary output folders specified on source
Lines 102-108 Link Here
102
 * followed by the any exported entries.
102
 * followed by the any exported entries.
103
 * <p>
103
 * <p>
104
 * This interface is not intended to be implemented by clients.
104
 * This interface is not intended to be implemented by clients.
105
 * Classpath entries can be created via methods on <code>JavaCore</code>.
105
 * Classpath entries can be created via methods on {@link JavaCore}.
106
 * </p>
106
 * </p>
107
 *
107
 *
108
 * @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
108
 * @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
Lines 170-180 Link Here
170
	 * Returns the kind of files found in the package fragments identified by this
170
	 * Returns the kind of files found in the package fragments identified by this
171
	 * classpath entry.
171
	 * classpath entry.
172
	 *
172
	 *
173
	 * @return <code>IPackageFragmentRoot.K_SOURCE</code> for files containing
173
	 * @return {@link IPackageFragmentRoot#K_SOURCE} for files containing
174
	 *   source code, and <code>IPackageFragmentRoot.K_BINARY</code> for binary
174
	 *   source code, and {@link IPackageFragmentRoot#K_BINARY} for binary
175
	 *   class files.
175
	 *   class files.
176
	 *   There is no specified value for an entry denoting a variable (<code>CPE_VARIABLE</code>)
176
	 *   There is no specified value for an entry denoting a variable ({@link #CPE_VARIABLE})
177
	 *   or a classpath container (<code>CPE_CONTAINER</code>).
177
	 *   or a classpath container ({@link #CPE_CONTAINER}).
178
	 */
178
	 */
179
	int getContentKind();
179
	int getContentKind();
180
180
Lines 183-198 Link Here
183
	 *
183
	 *
184
	 * @return one of:
184
	 * @return one of:
185
	 * <ul>
185
	 * <ul>
186
	 * <li><code>CPE_SOURCE</code> - this entry describes a source root in
186
	 * <li>{@link #CPE_SOURCE} - this entry describes a source root in
187
	 		its project
187
	 		its project
188
	 * <li><code>CPE_LIBRARY</code> - this entry describes a folder or JAR
188
	 * <li>{@link #CPE_LIBRARY} - this entry describes a folder or JAR
189
	 		containing binaries
189
	 		containing binaries
190
	 * <li><code>CPE_PROJECT</code> - this entry describes another project
190
	 * <li>{@link #CPE_PROJECT} - this entry describes another project
191
	 *
191
	 *
192
	 * <li><code>CPE_VARIABLE</code> - this entry describes a project or library
192
	 * <li>{@link #CPE_VARIABLE} - this entry describes a project or library
193
	 *  	indirectly via a classpath variable in the first segment of the path
193
	 *  	indirectly via a classpath variable in the first segment of the path
194
	 * *
194
	 * *
195
	 * <li><code>CPE_CONTAINER</code> - this entry describes set of entries
195
	 * <li>{@link #CPE_CONTAINER} - this entry describes set of entries
196
	 *  	referenced indirectly via a classpath container
196
	 *  	referenced indirectly via a classpath container
197
	 * </ul>
197
	 * </ul>
198
	 */
198
	 */
Lines 344-354 Link Here
344
	/**
344
	/**
345
	 * Returns the full path to the specific location where the builder writes 
345
	 * Returns the full path to the specific location where the builder writes 
346
	 * <code>.class</code> files generated for this source entry 
346
	 * <code>.class</code> files generated for this source entry 
347
	 * (entry kind <code>CPE_SOURCE</code>).
347
	 * (entry kind {@link #CPE_SOURCE}).
348
	 * <p>
348
	 * <p>
349
	 * Source entries can optionally be associated with a specific output location.
349
	 * Source entries can optionally be associated with a specific output location.
350
	 * If none is provided, the source entry will be implicitly associated with its project
350
	 * If none is provided, the source entry will be implicitly associated with its project
351
	 * default output location (see <code>IJavaProject#getOutputLocation</code>).
351
	 * default output location (see {@link IJavaProject#getOutputLocation}).
352
	 * </p><p>
352
	 * </p><p>
353
	 * NOTE: A specific output location cannot coincidate with another source/library entry.
353
	 * NOTE: A specific output location cannot coincidate with another source/library entry.
354
	 * </p>
354
	 * </p>
Lines 364-387 Link Here
364
	 * Returns the path of this classpath entry.
364
	 * Returns the path of this classpath entry.
365
	 *
365
	 *
366
	 * The meaning of the path of a classpath entry depends on its entry kind:<ul>
366
	 * The meaning of the path of a classpath entry depends on its entry kind:<ul>
367
	 *	<li>Source code in the current project (<code>CPE_SOURCE</code>) -  
367
	 *	<li>Source code in the current project ({@link #CPE_SOURCE}) -  
368
	 *      The path associated with this entry is the absolute path to the root folder. </li>
368
	 *      The path associated with this entry is the absolute path to the root folder. </li>
369
	 *	<li>A binary library in the current project (<code>CPE_LIBRARY</code>) - the path
369
	 *	<li>A binary library in the current project ({@link #CPE_LIBRARY}) - the path
370
	 *		associated with this entry is the absolute path to the JAR (or root folder), and 
370
	 *		associated with this entry is the absolute path to the JAR (or root folder), and 
371
	 *		in case it refers to an external JAR, then there is no associated resource in 
371
	 *		in case it refers to an external JAR, then there is no associated resource in 
372
	 *		the workbench.
372
	 *		the workbench.
373
	 *	<li>A required project (<code>CPE_PROJECT</code>) - the path of the entry denotes the
373
	 *	<li>A required project ({@link #CPE_PROJECT}) - the path of the entry denotes the
374
	 *		path to the corresponding project resource.</li>
374
	 *		path to the corresponding project resource.</li>
375
	 *  <li>A variable entry (<code>CPE_VARIABLE</code>) - the first segment of the path 
375
	 *  <li>A variable entry ({@link #CPE_VARIABLE}) - the first segment of the path 
376
	 *      is the name of a classpath variable. If this classpath variable
376
	 *      is the name of a classpath variable. If this classpath variable
377
	 *		is bound to the path <i>P</i>, the path of the corresponding classpath entry
377
	 *		is bound to the path <i>P</i>, the path of the corresponding classpath entry
378
	 *		is computed by appending to <i>P</i> the segments of the returned
378
	 *		is computed by appending to <i>P</i> the segments of the returned
379
	 *		path without the variable.</li>
379
	 *		path without the variable.</li>
380
	 *  <li> A container entry (<code>CPE_CONTAINER</code>) - the path of the entry
380
	 *  <li> A container entry ({@link #CPE_CONTAINER}) - the path of the entry
381
	 * 	is the name of the classpath container, which can be bound indirectly to a set of classpath 
381
	 * 	is the name of the classpath container, which can be bound indirectly to a set of classpath 
382
	 * 	entries after resolution. The containerPath is a formed by a first ID segment followed with 
382
	 * 	entries after resolution. The containerPath is a formed by a first ID segment followed with 
383
	 *     extra segments that can be used as additional hints for resolving this container 
383
	 *     extra segments that can be used as additional hints for resolving this container 
384
	 * 	reference (also see <code>IClasspathContainer</code>).
384
	 * 	reference (also see {@link IClasspathContainer}).
385
	 * </li>
385
	 * </li>
386
	 * </ul>
386
	 * </ul>
387
	 *
387
	 *
Lines 410-416 Link Here
410
	 * Returns the path within the source archive or folder where package fragments
410
	 * Returns the path within the source archive or folder where package fragments
411
	 * are located. An empty path indicates that packages are located at
411
	 * are located. An empty path indicates that packages are located at
412
	 * the root of the source archive or folder. Returns a non-<code>null</code> value
412
	 * the root of the source archive or folder. Returns a non-<code>null</code> value
413
	 * if and only if <code>getSourceAttachmentPath</code> returns 
413
	 * if and only if {@link #getSourceAttachmentPath} returns 
414
	 * a non-<code>null</code> value.
414
	 * a non-<code>null</code> value.
415
	 *
415
	 *
416
	 * @return the path within the source archive or folder, or <code>null</code> if
416
	 * @return the path within the source archive or folder, or <code>null</code> if
Lines 421-427 Link Here
421
	/**
421
	/**
422
	 * Returns whether this entry is exported to dependent projects.
422
	 * Returns whether this entry is exported to dependent projects.
423
	 * Always returns <code>false</code> for source entries (kind
423
	 * Always returns <code>false</code> for source entries (kind
424
	 * <code>CPE_SOURCE</code>), which cannot be exported.
424
	 * {@link #CPE_SOURCE}), which cannot be exported.
425
	 * 
425
	 * 
426
	 * @return <code>true</code> if exported, and <code>false</code> otherwise
426
	 * @return <code>true</code> if exported, and <code>false</code> otherwise
427
	 * @since 2.0
427
	 * @since 2.0
(-)model/org/eclipse/jdt/core/ClasspathVariableInitializer.java (+27 lines)
Lines 25-30 Link Here
25
 */
25
 */
26
public abstract class ClasspathVariableInitializer {
26
public abstract class ClasspathVariableInitializer {
27
27
28
	/**
29
	 * Additional flags associated with the initializer
30
	 */
31
	int flags = 0; // no flag
32
	final static int DEPRECATED = 0x01;
33
	final static int READ_ONLY  = 0x02;
34
28
    /**
35
    /**
29
     * Creates a new classpath variable initializer.
36
     * Creates a new classpath variable initializer.
30
     */
37
     */
Lines 49-52 Link Here
49
     * @see JavaCore#setClasspathVariables(String[], org.eclipse.core.runtime.IPath[], org.eclipse.core.runtime.IProgressMonitor)
56
     * @see JavaCore#setClasspathVariables(String[], org.eclipse.core.runtime.IPath[], org.eclipse.core.runtime.IProgressMonitor)
50
     */
57
     */
51
    public abstract void initialize(String variable);
58
    public abstract void initialize(String variable);
59
60
	/**
61
	 * Return whether the associated variable is deprecated or not.
62
	 * 
63
	 * @return <code>true</code> if the initialized variable is deprecated,
64
	 * 	<code>false</code> otherwise.
65
	 */
66
	public final boolean isDeprecated() {
67
		return (this.flags & DEPRECATED) != 0;
68
	}
69
70
	/**
71
	 * Return whether the initialized variable is read-only or not.
72
	 * 
73
	 * @return <code>true</code> if the initialized variable is read-only,
74
	 * 	<code>false</code> otherwise.
75
	 */
76
	public final boolean isReadOnly() {
77
		return (this.flags & READ_ONLY) != 0;
78
	}
52
}
79
}
(-)model/org/eclipse/jdt/core/JavaCore.java (-3 / +54 lines)
Lines 1612-1617 Link Here
1612
			return variablePath;
1612
			return variablePath;
1613
		}
1613
		}
1614
1614
1615
		return initializeClasspathVariable(variableName, variablePath);
1616
	}
1617
1618
	static IPath initializeClasspathVariable(final String variableName, IPath variablePath) {
1615
		// even if persisted value exists, initializer is given priority, only if no initializer is found the persisted value is reused
1619
		// even if persisted value exists, initializer is given priority, only if no initializer is found the persisted value is reused
1616
		final ClasspathVariableInitializer initializer = JavaCore.getClasspathVariableInitializer(variableName);
1620
		final ClasspathVariableInitializer initializer = JavaCore.getClasspathVariableInitializer(variableName);
1617
		if (initializer != null){
1621
		if (initializer != null){
Lines 1623-1628 Link Here
1623
					"	invocation stack trace:"); //$NON-NLS-1$
1627
					"	invocation stack trace:"); //$NON-NLS-1$
1624
				new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1628
				new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1625
			}
1629
			}
1630
		    JavaModelManager manager = JavaModelManager.getJavaModelManager();
1626
			manager.variablePut(variableName, JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS); // avoid initialization cycles
1631
			manager.variablePut(variableName, JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS); // avoid initialization cycles
1627
			boolean ok = false;
1632
			boolean ok = false;
1628
			try {
1633
			try {
Lines 1638-1644 Link Here
1638
						"	variable: " + variableName +'\n' + //$NON-NLS-1$
1643
						"	variable: " + variableName +'\n' + //$NON-NLS-1$
1639
						"	variable path: " + variablePath); //$NON-NLS-1$
1644
						"	variable path: " + variablePath); //$NON-NLS-1$
1640
				}
1645
				}
1641
				manager.variablesWithInitializer.add(variableName);
1646
				manager.variablesWithInitializer.put(variableName, initializer.flags);
1642
				ok = true;
1647
				ok = true;
1643
			} catch (RuntimeException e) {
1648
			} catch (RuntimeException e) {
1644
				if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1649
				if (JavaModelManager.CP_RESOLVE_VERBOSE) {
Lines 1662-1667 Link Here
1662
		}
1667
		}
1663
		return variablePath;
1668
		return variablePath;
1664
	}
1669
	}
1670
	public static boolean isClasspathVariableDeprecated(final String variableName) {
1671
	    JavaModelManager manager = JavaModelManager.getJavaModelManager();
1672
		IPath variablePath = manager.variableGet(variableName);
1673
		if (variablePath == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS){
1674
		    return false;  // currently do not store previous session result
1675
		}
1676
		
1677
		if (variablePath != null) {
1678
			if (variablePath == JavaModelManager.CP_ENTRY_IGNORE_PATH) {
1679
				return false;
1680
			}
1681
		} else {
1682
			initializeClasspathVariable(variableName, variablePath);
1683
		}
1684
1685
		int flags = manager.variableFlagsGet(variableName);
1686
		return (flags & 0x01) != 0;
1687
	}
1688
	public static boolean isClasspathVariableReadOnly(final String variableName) {
1689
	    JavaModelManager manager = JavaModelManager.getJavaModelManager();
1690
		IPath variablePath = manager.variableGet(variableName);
1691
		if (variablePath == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS){
1692
		    return false;  // currently do not store previous session result
1693
		}
1694
		
1695
		if (variablePath != null) {
1696
			if (variablePath == JavaModelManager.CP_ENTRY_IGNORE_PATH) {
1697
				return false;
1698
			}
1699
		} else {
1700
			initializeClasspathVariable(variableName, variablePath);
1701
		}
1702
1703
		int flags = manager.variableFlagsGet(variableName);
1704
		return (flags & 0x02) != 0;
1705
	}
1665
1706
1666
	/**
1707
	/**
1667
	 * Helper method finding the classpath variable initializer registered for a given classpath variable name 
1708
	 * Helper method finding the classpath variable initializer registered for a given classpath variable name 
Lines 1685-1691 Link Here
1685
				IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
1726
				IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
1686
				for(int j = 0; j < configElements.length; j++){
1727
				for(int j = 0; j < configElements.length; j++){
1687
					try {
1728
					try {
1688
						String varAttribute = configElements[j].getAttribute("variable"); //$NON-NLS-1$
1729
						IConfigurationElement configElement = configElements[j];
1730
						String varAttribute = configElement.getAttribute("variable"); //$NON-NLS-1$
1689
						if (variable.equals(varAttribute)) {
1731
						if (variable.equals(varAttribute)) {
1690
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1732
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1691
								Util.verbose(
1733
								Util.verbose(
Lines 1695-1701 Link Here
1695
							}						
1737
							}						
1696
							Object execExt = configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
1738
							Object execExt = configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
1697
							if (execExt instanceof ClasspathVariableInitializer){
1739
							if (execExt instanceof ClasspathVariableInitializer){
1698
								return (ClasspathVariableInitializer)execExt;
1740
								ClasspathVariableInitializer initializer = (ClasspathVariableInitializer)execExt;
1741
								String deprecatedAttribute = configElement.getAttribute("deprecated"); //$NON-NLS-1$
1742
								if (deprecatedAttribute != null) {
1743
									initializer.flags |= ClasspathVariableInitializer.DEPRECATED;
1744
								}
1745
								String readOnlyAttribute = configElement.getAttribute("readOnly"); //$NON-NLS-1$
1746
								if (JavaModelManager.TRUE.equals(readOnlyAttribute)) {
1747
									initializer.flags |= ClasspathVariableInitializer.READ_ONLY;
1748
								}
1749
								return initializer;
1699
							}
1750
							}
1700
						}
1751
						}
1701
					} catch(CoreException e){
1752
					} catch(CoreException e){
(-)model/org/eclipse/jdt/internal/core/JavaModelOperation.java (-1 / +1 lines)
Lines 61-67 Link Here
61
	protected HashMap attributes;
61
	protected HashMap attributes;
62
62
63
	public static final String HAS_MODIFIED_RESOURCE_ATTR = "hasModifiedResource"; //$NON-NLS-1$
63
	public static final String HAS_MODIFIED_RESOURCE_ATTR = "hasModifiedResource"; //$NON-NLS-1$
64
	public static final String TRUE = "true"; //$NON-NLS-1$
64
	public static final String TRUE = JavaModelManager.TRUE;
65
	//public static final String FALSE = "false";
65
	//public static final String FALSE = "false";
66
		
66
		
67
	/**
67
	/**
(-)model/org/eclipse/jdt/internal/core/JavaModelStatus.java (-44 / +73 lines)
Lines 126-132 Link Here
126
		this(code, new IJavaElement[]{element});
126
		this(code, new IJavaElement[]{element});
127
		this.string = string;
127
		this.string = string;
128
	}
128
	}
129
	
129
130
	/**
130
	/**
131
	 * Constructs an Java model status with the given corresponding
131
	 * Constructs an Java model status with the given corresponding
132
	 * element and path
132
	 * element and path
Lines 135-140 Link Here
135
		this(code, new IJavaElement[]{element});
135
		this(code, new IJavaElement[]{element});
136
		this.path = path;
136
		this.path = path;
137
	}	
137
	}	
138
139
	/**
140
	 * Constructs an Java model status with the given corresponding
141
	 * element and path
142
	 */
143
	public JavaModelStatus(int severity, int code, IJavaElement element, IPath path) {
144
		super(severity, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$
145
		this.elements= new IJavaElement[]{element};
146
		this.path = path;
147
	}	
148
138
	/**
149
	/**
139
	 * Constructs an Java model status with the given corresponding
150
	 * Constructs an Java model status with the given corresponding
140
	 * element, path and string
151
	 * element, path and string
Lines 326-378 Link Here
326
					if (description == null) description = path.makeRelative().toString();
337
					if (description == null) description = path.makeRelative().toString();
327
					return Messages.bind(Messages.classpath_invalidContainer, new String[] {description, javaProject.getElementName()}); 
338
					return Messages.bind(Messages.classpath_invalidContainer, new String[] {description, javaProject.getElementName()}); 
328
339
329
			case CP_VARIABLE_PATH_UNBOUND:
340
				case CP_VARIABLE_PATH_UNBOUND:
330
				javaProject = (IJavaProject)elements[0];
341
					javaProject = (IJavaProject)elements[0];
331
				return Messages.bind(Messages.classpath_unboundVariablePath, new String[] {path.makeRelative().toString(), javaProject.getElementName()}); 
342
					return Messages.bind(Messages.classpath_unboundVariablePath, new String[] {path.makeRelative().toString(), javaProject.getElementName()}); 
332
					
333
			case CLASSPATH_CYCLE: 
334
				javaProject = (IJavaProject)elements[0];
335
				return Messages.bind(Messages.classpath_cycle, javaProject.getElementName()); 
336
												 
337
			case DISABLED_CP_EXCLUSION_PATTERNS:
338
				javaProject = (IJavaProject)elements[0];
339
				String projectName = javaProject.getElementName();
340
				IPath newPath = path;
341
				if (path.segment(0).toString().equals(projectName)) {
342
					newPath = path.removeFirstSegments(1);
343
				}
344
				return Messages.bind(Messages.classpath_disabledInclusionExclusionPatterns, new String[] {newPath.makeRelative().toString(), projectName}); 
345
346
			case DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS:
347
				javaProject = (IJavaProject)elements[0];
348
				projectName = javaProject.getElementName();
349
				newPath = path;
350
				if (path.segment(0).toString().equals(projectName)) {
351
					newPath = path.removeFirstSegments(1);
352
				}
353
				return Messages.bind(Messages.classpath_disabledMultipleOutputLocations, new String[] {newPath.makeRelative().toString(), projectName}); 
354
343
355
			case INCOMPATIBLE_JDK_LEVEL:
344
				case CLASSPATH_CYCLE: 
356
					javaProject = (IJavaProject)elements[0];
345
					javaProject = (IJavaProject)elements[0];
357
					return Messages.bind(Messages.classpath_incompatibleLibraryJDKLevel, new String[]{	
346
					return Messages.bind(Messages.classpath_cycle, javaProject.getElementName()); 
358
						javaProject.getElementName(), 
347
359
						javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true), 
348
				case DISABLED_CP_EXCLUSION_PATTERNS:
360
						path.makeRelative().toString(),
349
					javaProject = (IJavaProject)elements[0];
361
						string,
350
					String projectName = javaProject.getElementName();
362
					});
351
					IPath newPath = path;
363
			case CANNOT_RETRIEVE_ATTACHED_JAVADOC :
352
					if (path.segment(0).toString().equals(projectName)) {
364
				if (elements != null && elements.length == 1) {
353
						newPath = path.removeFirstSegments(1);
354
					}
355
					return Messages.bind(Messages.classpath_disabledInclusionExclusionPatterns, new String[] {newPath.makeRelative().toString(), projectName}); 
356
357
				case DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS:
358
					javaProject = (IJavaProject)elements[0];
359
					projectName = javaProject.getElementName();
360
					newPath = path;
361
					if (path.segment(0).toString().equals(projectName)) {
362
						newPath = path.removeFirstSegments(1);
363
					}
364
					return Messages.bind(Messages.classpath_disabledMultipleOutputLocations, new String[] {newPath.makeRelative().toString(), projectName}); 
365
366
				case INCOMPATIBLE_JDK_LEVEL:
367
						javaProject = (IJavaProject)elements[0];
368
						return Messages.bind(Messages.classpath_incompatibleLibraryJDKLevel, new String[]{	
369
							javaProject.getElementName(), 
370
							javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true), 
371
							path.makeRelative().toString(),
372
							string,
373
						});
374
375
				case CANNOT_RETRIEVE_ATTACHED_JAVADOC :
376
					if (elements != null && elements.length == 1) {
377
						if (this.string != null) {
378
							return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, ((JavaElement)elements[0]).toStringWithAncestors(), this.string); 
379
						}
380
						return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, ((JavaElement)elements[0]).toStringWithAncestors(), ""); //$NON-NLS-1$
381
					}
365
					if (this.string != null) {
382
					if (this.string != null) {
366
						return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, ((JavaElement)elements[0]).toStringWithAncestors(), this.string); 
383
						return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, this.string, "");//$NON-NLS-1$
367
					}
384
					}
368
					return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, ((JavaElement)elements[0]).toStringWithAncestors(), ""); //$NON-NLS-1$
385
					break;
369
				}
386
370
				if (this.string != null) {
387
				case UNKNOWN_JAVADOC_FORMAT :
371
					return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, this.string, "");//$NON-NLS-1$
388
					return Messages.bind(Messages.status_unknown_javadoc_format, ((JavaElement)elements[0]).toStringWithAncestors()); 
372
				}
389
373
				break;
390
				case DEPRECATED_VARIABLE :
374
			case UNKNOWN_JAVADOC_FORMAT :
391
					javaProject = (IJavaProject)elements[0];
375
				return Messages.bind(Messages.status_unknown_javadoc_format, ((JavaElement)elements[0]).toStringWithAncestors()); 
392
					return Messages.bind(Messages.classpath_deprecated_variable, new String[] {path.segment(0).toString(), javaProject.getElementName()}); 
393
394
				case READ_ONLY_VARIABLE :
395
					javaProject = (IJavaProject)elements[0];
396
					return Messages.bind(Messages.classpath_read_only_variable, new String[] {path.segment(0).toString(), javaProject.getElementName()}); 
376
			}
397
			}
377
			if (string != null) {
398
			if (string != null) {
378
				return string;
399
				return string;
Lines 468-473 Link Here
468
		jms.children = children;
489
		jms.children = children;
469
		return jms;
490
		return jms;
470
	}
491
	}
492
	public static IJavaModelStatus newMultiStatus(IJavaModelStatus status, IJavaModelStatus[] children) {
493
		JavaModelStatus jmStatus = (JavaModelStatus) status;
494
		JavaModelStatus jms = new JavaModelStatus(status.getSeverity(), status.getCode(), jmStatus.string);
495
		jms.elements = jmStatus.elements;
496
		jms.path = jmStatus.path;
497
		jms.children = children;
498
		return jms;
499
	}
471
	/**
500
	/**
472
	 * Returns a printable representation of this exception for debugging
501
	 * Returns a printable representation of this exception for debugging
473
	 * purposes.
502
	 * purposes.
(-)model/org/eclipse/jdt/internal/core/ClasspathEntry.java (-1 / +20 lines)
Lines 26-31 Link Here
26
import org.eclipse.core.runtime.AssertionFailedException;
26
import org.eclipse.core.runtime.AssertionFailedException;
27
import org.eclipse.core.runtime.CoreException;
27
import org.eclipse.core.runtime.CoreException;
28
import org.eclipse.core.runtime.IPath;
28
import org.eclipse.core.runtime.IPath;
29
import org.eclipse.core.runtime.IStatus;
29
import org.eclipse.core.runtime.Path;
30
import org.eclipse.core.runtime.Path;
30
import org.eclipse.jdt.core.IAccessRule;
31
import org.eclipse.jdt.core.IAccessRule;
31
import org.eclipse.jdt.core.IClasspathAttribute;
32
import org.eclipse.jdt.core.IClasspathAttribute;
Lines 1627-1633 Link Here
1627
					if (entry == null){
1628
					if (entry == null){
1628
						return new JavaModelStatus(IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND, project, path);
1629
						return new JavaModelStatus(IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND, project, path);
1629
					}
1630
					}
1630
					return validateClasspathEntry(project, entry, checkSourceAttachment, recurseInContainers);
1631
					IJavaModelStatus status = validateClasspathEntry(project, entry, checkSourceAttachment, recurseInContainers);
1632
1633
					// variable may also be deprecated or read-only
1634
					String variableName = path.segment(0);
1635
					IJavaModelStatus[] children = new IJavaModelStatus[2];
1636
					int size = 0;
1637
					if (JavaCore.isClasspathVariableDeprecated(variableName)) {
1638
						children[size++] = new JavaModelStatus(IStatus.WARNING, IJavaModelStatusConstants.DEPRECATED_VARIABLE, project, path);
1639
					}
1640
					if (JavaCore.isClasspathVariableReadOnly(variableName)) {
1641
						children[size++] = new JavaModelStatus(IStatus.WARNING, IJavaModelStatusConstants.READ_ONLY_VARIABLE, project, path);
1642
					}
1643
					if (size > 0) {
1644
						if (size == 1) {
1645
							children = new IJavaModelStatus[] { children[0] };
1646
						}
1647
						status = JavaModelStatus.newMultiStatus(status, children);
1648
					}
1649
					return status;
1631
				} else {
1650
				} else {
1632
					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalVariablePath, new String[] {entryPathMsg, projectName}));					 
1651
					return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Messages.bind(Messages.classpath_illegalVariablePath, new String[] {entryPathMsg, projectName}));					 
1633
				}
1652
				}
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-25 / +30 lines)
Lines 86-92 Link Here
86
	 * Classpath variables pool
86
	 * Classpath variables pool
87
	 */
87
	 */
88
	public HashMap variables = new HashMap(5);
88
	public HashMap variables = new HashMap(5);
89
	public HashSet variablesWithInitializer = new HashSet(5);
89
	public HashtableOfObjectToInt variablesWithInitializer = new HashtableOfObjectToInt(5);
90
	public HashMap previousSessionVariables = new HashMap(5);
90
	public HashMap previousSessionVariables = new HashMap(5);
91
	private ThreadLocal variableInitializationInProgress = new ThreadLocal();
91
	private ThreadLocal variableInitializationInProgress = new ThreadLocal();
92
		
92
		
Lines 120-125 Link Here
120
	public final static String CP_CONTAINER_PREFERENCES_PREFIX = JavaCore.PLUGIN_ID+".classpathContainer."; //$NON-NLS-1$
120
	public final static String CP_CONTAINER_PREFERENCES_PREFIX = JavaCore.PLUGIN_ID+".classpathContainer."; //$NON-NLS-1$
121
	public final static String CP_ENTRY_IGNORE = "##<cp entry ignore>##"; //$NON-NLS-1$
121
	public final static String CP_ENTRY_IGNORE = "##<cp entry ignore>##"; //$NON-NLS-1$
122
	public final static IPath CP_ENTRY_IGNORE_PATH = new Path(CP_ENTRY_IGNORE);
122
	public final static IPath CP_ENTRY_IGNORE_PATH = new Path(CP_ENTRY_IGNORE);
123
	public final static String TRUE = "true"; //$NON-NLS-1$
123
	
124
	
124
	private final static int VARIABLES_AND_CONTAINERS_FILE_VERSION = 2;
125
	private final static int VARIABLES_AND_CONTAINERS_FILE_VERSION = 2;
125
126
Lines 278-286 Link Here
278
						continue;
279
						continue;
279
					}
280
					}
280
					// add config element in the group it belongs to
281
					// add config element in the group it belongs to
281
					if ("true".equals(configElement.getAttribute("modifiesEnvironment"))) //$NON-NLS-1$ //$NON-NLS-2$
282
					if (TRUE.equals(configElement.getAttribute("modifiesEnvironment"))) //$NON-NLS-1$
282
						modifyingEnv.add(configElement);
283
						modifyingEnv.add(configElement);
283
					else if ("true".equals(configElement.getAttribute("createsProblems"))) //$NON-NLS-1$ //$NON-NLS-2$
284
					else if (TRUE.equals(configElement.getAttribute("createsProblems"))) //$NON-NLS-1$
284
						creatingProblems.add(configElement);
285
						creatingProblems.add(configElement);
285
					else
286
					else
286
						others.add(configElement);
287
						others.add(configElement);
Lines 1124-1135 Link Here
1124
			if (propertyName.startsWith(CP_VARIABLE_PREFERENCES_PREFIX)) {
1125
			if (propertyName.startsWith(CP_VARIABLE_PREFERENCES_PREFIX)) {
1125
				String varName = propertyName.substring(CP_VARIABLE_PREFERENCES_PREFIX.length());
1126
				String varName = propertyName.substring(CP_VARIABLE_PREFERENCES_PREFIX.length());
1126
				JavaModelManager manager = getJavaModelManager();
1127
				JavaModelManager manager = getJavaModelManager();
1127
				if (manager.variablesWithInitializer.contains(varName)) {
1128
				if (manager.variablesWithInitializer.containsKey(varName)) {
1128
					// revert preference value as we will not apply it to JavaCore classpath variable
1129
					// revert preference value as we will not apply it to JavaCore classpath variable
1129
					String oldValue = (String) event.getOldValue();
1130
					String oldValue = (String) event.getOldValue();
1130
					if (oldValue == null) {
1131
					if (oldValue == null) {
1131
						// unexpected old value => remove variable from set
1132
						// unexpected old value => remove variable from set
1132
						manager.variablesWithInitializer.remove(varName);
1133
						manager.variablesWithInitializer.removeKey(varName);
1133
					} else {
1134
					} else {
1134
						manager.getInstancePreferences().put(varName, oldValue);
1135
						manager.getInstancePreferences().put(varName, oldValue);
1135
					}
1136
					}
Lines 1200-1257 Link Here
1200
	public void configurePluginDebugOptions(){
1201
	public void configurePluginDebugOptions(){
1201
		if(JavaCore.getPlugin().isDebugging()){
1202
		if(JavaCore.getPlugin().isDebugging()){
1202
			String option = Platform.getDebugOption(BUFFER_MANAGER_DEBUG);
1203
			String option = Platform.getDebugOption(BUFFER_MANAGER_DEBUG);
1203
			if(option != null) BufferManager.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1204
			if(option != null) BufferManager.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1204
			
1205
			
1205
			option = Platform.getDebugOption(BUILDER_DEBUG);
1206
			option = Platform.getDebugOption(BUILDER_DEBUG);
1206
			if(option != null) JavaBuilder.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1207
			if(option != null) JavaBuilder.DEBUG = option.equalsIgnoreCase(TRUE) ;
1207
			
1208
			
1208
			option = Platform.getDebugOption(COMPILER_DEBUG);
1209
			option = Platform.getDebugOption(COMPILER_DEBUG);
1209
			if(option != null) Compiler.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1210
			if(option != null) Compiler.DEBUG = option.equalsIgnoreCase(TRUE) ;
1210
1211
1211
			option = Platform.getDebugOption(COMPLETION_DEBUG);
1212
			option = Platform.getDebugOption(COMPLETION_DEBUG);
1212
			if(option != null) CompletionEngine.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1213
			if(option != null) CompletionEngine.DEBUG = option.equalsIgnoreCase(TRUE) ;
1213
			
1214
			
1214
			option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
1215
			option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
1215
			if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1216
			if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase(TRUE) ;
1216
1217
1217
			option = Platform.getDebugOption(DELTA_DEBUG);
1218
			option = Platform.getDebugOption(DELTA_DEBUG);
1218
			if(option != null) DeltaProcessor.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1219
			if(option != null) DeltaProcessor.DEBUG = option.equalsIgnoreCase(TRUE) ;
1219
1220
1220
			option = Platform.getDebugOption(DELTA_DEBUG_VERBOSE);
1221
			option = Platform.getDebugOption(DELTA_DEBUG_VERBOSE);
1221
			if(option != null) DeltaProcessor.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1222
			if(option != null) DeltaProcessor.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1222
1223
1223
			option = Platform.getDebugOption(HIERARCHY_DEBUG);
1224
			option = Platform.getDebugOption(HIERARCHY_DEBUG);
1224
			if(option != null) TypeHierarchy.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1225
			if(option != null) TypeHierarchy.DEBUG = option.equalsIgnoreCase(TRUE) ;
1225
1226
1226
			option = Platform.getDebugOption(INDEX_MANAGER_DEBUG);
1227
			option = Platform.getDebugOption(INDEX_MANAGER_DEBUG);
1227
			if(option != null) JobManager.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1228
			if(option != null) JobManager.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1228
			
1229
			
1229
			option = Platform.getDebugOption(JAVAMODEL_DEBUG);
1230
			option = Platform.getDebugOption(JAVAMODEL_DEBUG);
1230
			if(option != null) JavaModelManager.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1231
			if(option != null) JavaModelManager.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1231
1232
1232
			option = Platform.getDebugOption(JAVAMODELCACHE_DEBUG);
1233
			option = Platform.getDebugOption(JAVAMODELCACHE_DEBUG);
1233
			if(option != null) JavaModelCache.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1234
			if(option != null) JavaModelCache.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1234
1235
1235
			option = Platform.getDebugOption(POST_ACTION_DEBUG);
1236
			option = Platform.getDebugOption(POST_ACTION_DEBUG);
1236
			if(option != null) JavaModelOperation.POST_ACTION_VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1237
			if(option != null) JavaModelOperation.POST_ACTION_VERBOSE = option.equalsIgnoreCase(TRUE) ;
1237
1238
1238
			option = Platform.getDebugOption(RESOLUTION_DEBUG);
1239
			option = Platform.getDebugOption(RESOLUTION_DEBUG);
1239
			if(option != null) NameLookup.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1240
			if(option != null) NameLookup.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1240
1241
1241
			option = Platform.getDebugOption(SEARCH_DEBUG);
1242
			option = Platform.getDebugOption(SEARCH_DEBUG);
1242
			if(option != null) BasicSearchEngine.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1243
			if(option != null) BasicSearchEngine.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1243
1244
1244
			option = Platform.getDebugOption(SELECTION_DEBUG);
1245
			option = Platform.getDebugOption(SELECTION_DEBUG);
1245
			if(option != null) SelectionEngine.DEBUG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1246
			if(option != null) SelectionEngine.DEBUG = option.equalsIgnoreCase(TRUE) ;
1246
1247
1247
			option = Platform.getDebugOption(ZIP_ACCESS_DEBUG);
1248
			option = Platform.getDebugOption(ZIP_ACCESS_DEBUG);
1248
			if(option != null) JavaModelManager.ZIP_ACCESS_VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1249
			if(option != null) JavaModelManager.ZIP_ACCESS_VERBOSE = option.equalsIgnoreCase(TRUE) ;
1249
			
1250
			
1250
			option = Platform.getDebugOption(SOURCE_MAPPER_DEBUG_VERBOSE);
1251
			option = Platform.getDebugOption(SOURCE_MAPPER_DEBUG_VERBOSE);
1251
			if(option != null) SourceMapper.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1252
			if(option != null) SourceMapper.VERBOSE = option.equalsIgnoreCase(TRUE) ;
1252
			
1253
			
1253
			option = Platform.getDebugOption(ENABLE_NEW_FORMATTER);
1254
			option = Platform.getDebugOption(ENABLE_NEW_FORMATTER);
1254
			if(option != null) DefaultCodeFormatter.USE_NEW_FORMATTER = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
1255
			if(option != null) DefaultCodeFormatter.USE_NEW_FORMATTER = option.equalsIgnoreCase(TRUE) ;
1255
		}
1256
		}
1256
		
1257
		
1257
		// configure performance options
1258
		// configure performance options
Lines 3949-3955 Link Here
3949
		
3950
		
3950
		// Note: no need to close the Java model as this just removes Java element infos from the Java model cache
3951
		// Note: no need to close the Java model as this just removes Java element infos from the Java model cache
3951
	}
3952
	}
3952
		
3953
3953
	public synchronized IPath variableGet(String variableName){
3954
	public synchronized IPath variableGet(String variableName){
3954
		// check initialization in progress first
3955
		// check initialization in progress first
3955
		HashSet initializations = variableInitializationInProgress();
3956
		HashSet initializations = variableInitializationInProgress();
Lines 3959-3964 Link Here
3959
		return (IPath)this.variables.get(variableName);
3960
		return (IPath)this.variables.get(variableName);
3960
	}
3961
	}
3961
3962
3963
	public synchronized int variableFlagsGet(String variableName){
3964
		return this.variablesWithInitializer.get(variableName);
3965
	}
3966
3962
	/*
3967
	/*
3963
	 * Returns the set of variable names that are being initialized in the current thread.
3968
	 * Returns the set of variable names that are being initialized in the current thread.
3964
	 */
3969
	 */
Lines 4010-4016 Link Here
4010
	public void variablePreferencesPut(String variableName, IPath variablePath) {
4015
	public void variablePreferencesPut(String variableName, IPath variablePath) {
4011
		String variableKey = CP_VARIABLE_PREFERENCES_PREFIX+variableName;
4016
		String variableKey = CP_VARIABLE_PREFERENCES_PREFIX+variableName;
4012
		if (variablePath == null) {
4017
		if (variablePath == null) {
4013
			this.variablesWithInitializer.remove(variableName);
4018
			this.variablesWithInitializer.removeKey(variableName);
4014
			getInstancePreferences().remove(variableKey);
4019
			getInstancePreferences().remove(variableKey);
4015
		} else {
4020
		} else {
4016
			getInstancePreferences().put(variableKey, variablePath.toString());
4021
			getInstancePreferences().put(variableKey, variablePath.toString());
(-)schema/classpathVariableInitializer.exsd (+17 lines)
Lines 63-68 Link Here
63
               </appInfo>
63
               </appInfo>
64
            </annotation>
64
            </annotation>
65
         </attribute>
65
         </attribute>
66
         <attribute name="deprecated" type="string">
67
            <annotation>
68
               <documentation>
69
                  String explaining the reason why the associated variable is deprecated
70
               </documentation>
71
               <appInfo>
72
                  <meta.attribute translatable="true"/>
73
               </appInfo>
74
            </annotation>
75
         </attribute>
76
         <attribute name="readOnly" type="boolean">
77
            <annotation>
78
               <documentation>
79
                  Indicates that the associated variable cannot be modified
80
               </documentation>
81
            </annotation>
82
         </attribute>
66
      </complexType>
83
      </complexType>
67
   </element>
84
   </element>
68
85
(-)model/org/eclipse/jdt/internal/core/util/messages.properties (+2 lines)
Lines 167-172 Link Here
167
classpath_disabledMultipleOutputLocations = Multiple output locations are disabled in project {1}, cannot associate entry: ''{0}'' with a specific output
167
classpath_disabledMultipleOutputLocations = Multiple output locations are disabled in project {1}, cannot associate entry: ''{0}'' with a specific output
168
classpath_incompatibleLibraryJDKLevel = Incompatible .class files version in required binaries. Project ''{0}'' is targeting a {1} runtime, but is compiled against ''{2}'' which requires a {3} runtime
168
classpath_incompatibleLibraryJDKLevel = Incompatible .class files version in required binaries. Project ''{0}'' is targeting a {1} runtime, but is compiled against ''{2}'' which requires a {3} runtime
169
classpath_duplicateEntryExtraAttribute = Duplicate extra attribute: ''{0}'' in classpath entry ''{1}'' for project {2}
169
classpath_duplicateEntryExtraAttribute = Duplicate extra attribute: ''{0}'' in classpath entry ''{1}'' for project {2}
170
classpath_deprecated_variable = Classpath variable ''{0}'' in project {1} is deprecated
171
classpath_read_only_variable = Classpath variable ''{0}'' in project {1} is read only
170
172
171
### miscellaneous
173
### miscellaneous
172
file_notFound = File not found: ''{0}''
174
file_notFound = File not found: ''{0}''
(-)model/org/eclipse/jdt/internal/core/util/Messages.java (+2 lines)
Lines 161-166 Link Here
161
	public static String classpath_disabledMultipleOutputLocations;
161
	public static String classpath_disabledMultipleOutputLocations;
162
	public static String classpath_incompatibleLibraryJDKLevel;
162
	public static String classpath_incompatibleLibraryJDKLevel;
163
	public static String classpath_duplicateEntryExtraAttribute;
163
	public static String classpath_duplicateEntryExtraAttribute;
164
	public static String classpath_deprecated_variable;
165
	public static String classpath_read_only_variable;
164
	public static String file_notFound;
166
	public static String file_notFound;
165
	public static String file_badFormat;
167
	public static String file_badFormat;
166
	public static String path_nullPath;
168
	public static String path_nullPath;

Return to bug 138599