View | Details | Raw Unified | Return to bug 178039
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/SetVariablesOperation.java (-16 / +27 lines)
Lines 43-54 Link Here
43
		checkCanceled();
43
		checkCanceled();
44
		try {
44
		try {
45
			beginTask("", 1); //$NON-NLS-1$
45
			beginTask("", 1); //$NON-NLS-1$
46
			if (JavaModelManager.CP_RESOLVE_VERBOSE){
46
			if (JavaModelManager.CP_RESOLVE_VERBOSE)
47
				Util.verbose(
47
				verbose_set_variables();
48
					"CPVariable SET  - setting variables\n" + //$NON-NLS-1$
49
					"	variables: " + org.eclipse.jdt.internal.compiler.util.Util.toString(this.variableNames) + '\n' +//$NON-NLS-1$
50
					"	values: " + org.eclipse.jdt.internal.compiler.util.Util.toString(this.variablePaths)); //$NON-NLS-1$
51
			}
52
			
48
			
53
			JavaModelManager manager = JavaModelManager.getJavaModelManager();
49
			JavaModelManager manager = JavaModelManager.getJavaModelManager();
54
			if (manager.variablePutIfInitializingWithSameValue(this.variableNames, this.variablePaths))
50
			if (manager.variablePutIfInitializingWithSameValue(this.variableNames, this.variablePaths))
Lines 142-154 Link Here
142
	
138
	
143
						JavaProject affectedProject = (JavaProject) projectsToUpdate.next();
139
						JavaProject affectedProject = (JavaProject) projectsToUpdate.next();
144
	
140
	
145
						if (JavaModelManager.CP_RESOLVE_VERBOSE){
146
							Util.verbose(
147
								"CPVariable SET  - updating affected project due to setting variables\n" + //$NON-NLS-1$
148
								"	project: " + affectedProject.getElementName() + '\n' + //$NON-NLS-1$
149
								"	variables: " + org.eclipse.jdt.internal.compiler.util.Util.toString(dbgVariableNames)); //$NON-NLS-1$
150
						}
151
						// force resolved classpath to be recomputed
141
						// force resolved classpath to be recomputed
142
						if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
143
							verbose_update_project(dbgVariableNames, affectedProject);
152
						affectedProject.getPerProjectInfo().resetResolvedClasspath();
144
						affectedProject.getPerProjectInfo().resetResolvedClasspath();
153
						
145
						
154
						// if needed, generate delta, update project ref, create markers, ...
146
						// if needed, generate delta, update project ref, create markers, ...
Lines 161-170 Link Here
161
					}
153
					}
162
				} catch (CoreException e) {
154
				} catch (CoreException e) {
163
					if (JavaModelManager.CP_RESOLVE_VERBOSE){
155
					if (JavaModelManager.CP_RESOLVE_VERBOSE){
164
						Util.verbose(
156
						verbose_failure(dbgVariableNames); 
165
							"CPVariable SET  - FAILED DUE TO EXCEPTION\n" + //$NON-NLS-1$
166
							"	variables: " + org.eclipse.jdt.internal.compiler.util.Util.toString(dbgVariableNames), //$NON-NLS-1$
167
							System.err); 
168
						e.printStackTrace();
157
						e.printStackTrace();
169
					}
158
					}
170
					if (e instanceof JavaModelException) {
159
					if (e instanceof JavaModelException) {
Lines 179-182 Link Here
179
		}
168
		}
180
	}
169
	}
181
170
171
	private void verbose_failure(String[] dbgVariableNames) {
172
		Util.verbose(
173
			"CPVariable SET  - FAILED DUE TO EXCEPTION\n" + //$NON-NLS-1$
174
			"	variables: " + org.eclipse.jdt.internal.compiler.util.Util.toString(dbgVariableNames), //$NON-NLS-1$
175
			System.err);
176
	}
177
178
	private void verbose_update_project(String[] dbgVariableNames,
179
			JavaProject affectedProject) {
180
		Util.verbose(
181
			"CPVariable SET  - updating affected project due to setting variables\n" + //$NON-NLS-1$
182
			"	project: " + affectedProject.getElementName() + '\n' + //$NON-NLS-1$
183
			"	variables: " + org.eclipse.jdt.internal.compiler.util.Util.toString(dbgVariableNames)); //$NON-NLS-1$
184
	}
185
186
	private void verbose_set_variables() {
187
		Util.verbose(
188
			"CPVariable SET  - setting variables\n" + //$NON-NLS-1$
189
			"	variables: " + org.eclipse.jdt.internal.compiler.util.Util.toString(this.variableNames) + '\n' +//$NON-NLS-1$
190
			"	values: " + org.eclipse.jdt.internal.compiler.util.Util.toString(this.variablePaths)); //$NON-NLS-1$
191
	}
192
182
}
193
}
(-)model/org/eclipse/jdt/internal/core/JavaProject.java (-7 / +10 lines)
Lines 1884-1896 Link Here
1884
	 */
1884
	 */
1885
	public IClasspathEntry[] getResolvedClasspath(boolean ignoreUnresolvedEntry) throws JavaModelException {
1885
	public IClasspathEntry[] getResolvedClasspath(boolean ignoreUnresolvedEntry) throws JavaModelException {
1886
		if  (JavaModelManager.getJavaModelManager().isClasspathBeingResolved(this)) {
1886
		if  (JavaModelManager.getJavaModelManager().isClasspathBeingResolved(this)) {
1887
			if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1887
			if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1888
				Util.verbose(
1888
				verbose_reentering_classpath_resolution();
1889
					"CPResolution: reentering raw classpath resolution, will use empty classpath instead" + //$NON-NLS-1$
1890
					"	project: " + getElementName() + '\n' + //$NON-NLS-1$
1891
					"	invocation stack trace:"); //$NON-NLS-1$
1892
				new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1893
			}						
1894
		    return RESOLUTION_IN_PROGRESS;
1889
		    return RESOLUTION_IN_PROGRESS;
1895
		}
1890
		}
1896
		PerProjectInfo perProjectInfo = getPerProjectInfo();
1891
		PerProjectInfo perProjectInfo = getPerProjectInfo();
Lines 1916-1921 Link Here
1916
		return resolvedClasspath;
1911
		return resolvedClasspath;
1917
	}
1912
	}
1918
1913
1914
	private void verbose_reentering_classpath_resolution() {
1915
		Util.verbose(
1916
			"CPResolution: reentering raw classpath resolution, will use empty classpath instead" + //$NON-NLS-1$
1917
			"	project: " + getElementName() + '\n' + //$NON-NLS-1$
1918
			"	invocation stack trace:"); //$NON-NLS-1$
1919
		new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1920
	}
1921
1919
	/**
1922
	/**
1920
	 * @see IJavaElement
1923
	 * @see IJavaElement
1921
	 */
1924
	 */
(-)model/org/eclipse/jdt/internal/core/SetContainerOperation.java (-2 / +10 lines)
Lines 42-47 Link Here
42
			beginTask("", 1); //$NON-NLS-1$
42
			beginTask("", 1); //$NON-NLS-1$
43
			if (JavaModelManager.CP_RESOLVE_VERBOSE)
43
			if (JavaModelManager.CP_RESOLVE_VERBOSE)
44
				verbose_set_container();
44
				verbose_set_container();
45
			if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
46
				verbose_set_container_invocation_trace();
45
			
47
			
46
			JavaModelManager manager = JavaModelManager.getJavaModelManager();
48
			JavaModelManager manager = JavaModelManager.getJavaModelManager();
47
			if (manager.containerPutIfInitializingWithSameEntries(this.containerPath, this.affectedProjects, this.respectiveContainers))
49
			if (manager.containerPutIfInitializingWithSameEntries(this.containerPath, this.affectedProjects, this.respectiveContainers))
Lines 100-106 Link Here
100
					
102
					
101
					JavaProject affectedProject = (JavaProject)modifiedProjects[i];
103
					JavaProject affectedProject = (JavaProject)modifiedProjects[i];
102
					if (affectedProject == null) continue; // was filtered out
104
					if (affectedProject == null) continue; // was filtered out
103
					if (JavaModelManager.CP_RESOLVE_VERBOSE)
105
					if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
104
						verbose_update_project(affectedProject);
106
						verbose_update_project(affectedProject);
105
		
107
		
106
					// force resolved classpath to be recomputed
108
					// force resolved classpath to be recomputed
Lines 190-196 Link Here
190
						return buffer.toString();
192
						return buffer.toString();
191
					}
193
					}
192
				}) +
194
				}) +
193
			"\n	}\n	invocation stack trace:"); //$NON-NLS-1$
195
			"\n	}");//$NON-NLS-1$
196
	}
197
	
198
	private void verbose_set_container_invocation_trace() {
199
		Util.verbose(
200
			"CPContainer SET  - setting container\n" + //$NON-NLS-1$
201
			"	invocation stack trace:"); //$NON-NLS-1$
194
			new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
202
			new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
195
	}
203
	}
196
	
204
	
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (-141 / +191 lines)
Lines 175-180 Link Here
175
	private static final String JAVAMODEL_DEBUG = JavaCore.PLUGIN_ID + "/debug/javamodel" ; //$NON-NLS-1$
175
	private static final String JAVAMODEL_DEBUG = JavaCore.PLUGIN_ID + "/debug/javamodel" ; //$NON-NLS-1$
176
	private static final String JAVAMODELCACHE_DEBUG = JavaCore.PLUGIN_ID + "/debug/javamodel/cache" ; //$NON-NLS-1$
176
	private static final String JAVAMODELCACHE_DEBUG = JavaCore.PLUGIN_ID + "/debug/javamodel/cache" ; //$NON-NLS-1$
177
	private static final String CP_RESOLVE_DEBUG = JavaCore.PLUGIN_ID + "/debug/cpresolution" ; //$NON-NLS-1$
177
	private static final String CP_RESOLVE_DEBUG = JavaCore.PLUGIN_ID + "/debug/cpresolution" ; //$NON-NLS-1$
178
	private static final String CP_RESOLVE_ADVANCED_DEBUG = JavaCore.PLUGIN_ID + "/debug/cpresolution/advanced" ; //$NON-NLS-1$
178
	private static final String ZIP_ACCESS_DEBUG = JavaCore.PLUGIN_ID + "/debug/zipaccess" ; //$NON-NLS-1$
179
	private static final String ZIP_ACCESS_DEBUG = JavaCore.PLUGIN_ID + "/debug/zipaccess" ; //$NON-NLS-1$
179
	private static final String DELTA_DEBUG =JavaCore.PLUGIN_ID + "/debug/javadelta" ; //$NON-NLS-1$
180
	private static final String DELTA_DEBUG =JavaCore.PLUGIN_ID + "/debug/javadelta" ; //$NON-NLS-1$
180
	private static final String DELTA_DEBUG_VERBOSE =JavaCore.PLUGIN_ID + "/debug/javadelta/verbose" ; //$NON-NLS-1$
181
	private static final String DELTA_DEBUG_VERBOSE =JavaCore.PLUGIN_ID + "/debug/javadelta/verbose" ; //$NON-NLS-1$
Lines 537-609 Link Here
537
				containerPut(project, containerPath, container);
538
				containerPut(project, containerPath, container);
538
				return true;
539
				return true;
539
			} else {
540
			} else {
541
				if (CP_RESOLVE_VERBOSE)
542
					verbose_missbehaving_container(containerPath, projects, respectiveContainers, container, newEntries, null/*no old entries*/);
540
				return false;
543
				return false;
541
			}
544
			}
542
		final IClasspathEntry[] oldEntries = previousContainer.getClasspathEntries();
545
		final IClasspathEntry[] oldEntries = previousContainer.getClasspathEntries();
543
		if (oldEntries.length != newEntries.length) 
546
		if (oldEntries.length != newEntries.length) {
547
			if (CP_RESOLVE_VERBOSE)
548
				verbose_missbehaving_container(containerPath, projects, respectiveContainers, container, newEntries, oldEntries);
544
			return false;
549
			return false;
550
		}
545
		for (int i = 0, length = newEntries.length; i < length; i++) {
551
		for (int i = 0, length = newEntries.length; i < length; i++) {
546
			if (!newEntries[i].equals(oldEntries[i])) {
552
			if (!newEntries[i].equals(oldEntries[i])) {
547
				if (CP_RESOLVE_VERBOSE) {
553
				if (CP_RESOLVE_VERBOSE)
548
					Util.verbose(
554
					verbose_missbehaving_container(containerPath, projects, respectiveContainers, container, newEntries, oldEntries);
549
						"CPContainer SET  - missbehaving container\n" + //$NON-NLS-1$
550
						"	container path: " + containerPath + '\n' + //$NON-NLS-1$
551
						"	projects: {" +//$NON-NLS-1$
552
						org.eclipse.jdt.internal.compiler.util.Util.toString(
553
							projects, 
554
							new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
555
								public String displayString(Object o) { return ((IJavaProject) o).getElementName(); }
556
							}) +
557
						"}\n	values on previous session: {\n"  +//$NON-NLS-1$
558
						org.eclipse.jdt.internal.compiler.util.Util.toString(
559
							respectiveContainers, 
560
							new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
561
								public String displayString(Object o) { 
562
									StringBuffer buffer = new StringBuffer("		"); //$NON-NLS-1$
563
									if (o == null) {
564
										buffer.append("<null>"); //$NON-NLS-1$
565
										return buffer.toString();
566
									}
567
									buffer.append(container.getDescription());
568
									buffer.append(" {\n"); //$NON-NLS-1$
569
									for (int j = 0; j < oldEntries.length; j++){
570
										buffer.append(" 			"); //$NON-NLS-1$
571
										buffer.append(oldEntries[j]); 
572
										buffer.append('\n'); 
573
									}
574
									buffer.append(" 		}"); //$NON-NLS-1$
575
									return buffer.toString();
576
								}
577
							}) +
578
						"}\n	new values: {\n"  +//$NON-NLS-1$
579
						org.eclipse.jdt.internal.compiler.util.Util.toString(
580
							respectiveContainers, 
581
							new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
582
								public String displayString(Object o) { 
583
									StringBuffer buffer = new StringBuffer("		"); //$NON-NLS-1$
584
									if (o == null) {
585
										buffer.append("<null>"); //$NON-NLS-1$
586
										return buffer.toString();
587
									}
588
									buffer.append(container.getDescription());
589
									buffer.append(" {\n"); //$NON-NLS-1$
590
									for (int j = 0; j < newEntries.length; j++){
591
										buffer.append(" 			"); //$NON-NLS-1$
592
										buffer.append(newEntries[j]); 
593
										buffer.append('\n'); 
594
									}
595
									buffer.append(" 		}"); //$NON-NLS-1$
596
									return buffer.toString();
597
								}
598
							}) +
599
						"\n	}"); //$NON-NLS-1$
600
				}
601
				return false;
555
				return false;
602
			}
556
			}
603
		}
557
		}
604
		containerPut(project, containerPath, container);
558
		containerPut(project, containerPath, container);
605
		return true;
559
		return true;
606
	}
560
	}
561
562
	private void verbose_missbehaving_container(
563
			IPath containerPath,
564
			IJavaProject[] projects,
565
			IClasspathContainer[] respectiveContainers,
566
			final IClasspathContainer container,
567
			final IClasspathEntry[] newEntries,
568
			final IClasspathEntry[] oldEntries) {
569
		Util.verbose(
570
			"CPContainer SET  - missbehaving container\n" + //$NON-NLS-1$
571
			"	container path: " + containerPath + '\n' + //$NON-NLS-1$
572
			"	projects: {" +//$NON-NLS-1$
573
			org.eclipse.jdt.internal.compiler.util.Util.toString(
574
				projects, 
575
				new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
576
					public String displayString(Object o) { return ((IJavaProject) o).getElementName(); }
577
				}) +
578
			"}\n	values on previous session: {\n"  +//$NON-NLS-1$
579
			org.eclipse.jdt.internal.compiler.util.Util.toString(
580
				respectiveContainers, 
581
				new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
582
					public String displayString(Object o) { 
583
						StringBuffer buffer = new StringBuffer("		"); //$NON-NLS-1$
584
						if (o == null) {
585
							buffer.append("<null>"); //$NON-NLS-1$
586
							return buffer.toString();
587
						}
588
						buffer.append(container.getDescription());
589
						buffer.append(" {\n"); //$NON-NLS-1$
590
						if (oldEntries == null) {
591
							buffer.append(" 			"); //$NON-NLS-1$
592
							buffer.append("<null>\n"); //$NON-NLS-1$
593
						} else {
594
							for (int j = 0; j < oldEntries.length; j++){
595
								buffer.append(" 			"); //$NON-NLS-1$
596
								buffer.append(oldEntries[j]); 
597
								buffer.append('\n'); 
598
							}
599
						}
600
						buffer.append(" 		}"); //$NON-NLS-1$
601
						return buffer.toString();
602
					}
603
				}) +
604
			"}\n	new values: {\n"  +//$NON-NLS-1$
605
			org.eclipse.jdt.internal.compiler.util.Util.toString(
606
				respectiveContainers, 
607
				new org.eclipse.jdt.internal.compiler.util.Util.Displayable(){ 
608
					public String displayString(Object o) { 
609
						StringBuffer buffer = new StringBuffer("		"); //$NON-NLS-1$
610
						if (o == null) {
611
							buffer.append("<null>"); //$NON-NLS-1$
612
							return buffer.toString();
613
						}
614
						buffer.append(container.getDescription());
615
						buffer.append(" {\n"); //$NON-NLS-1$
616
						for (int j = 0; j < newEntries.length; j++){
617
							buffer.append(" 			"); //$NON-NLS-1$
618
							buffer.append(newEntries[j]); 
619
							buffer.append('\n'); 
620
						}
621
						buffer.append(" 		}"); //$NON-NLS-1$
622
						return buffer.toString();
623
					}
624
				}) +
625
			"\n	}"); //$NON-NLS-1$
626
	}
607
	
627
	
608
	private void containerRemoveInitializationInProgress(IJavaProject project, IPath containerPath) {
628
	private void containerRemoveInitializationInProgress(IJavaProject project, IPath containerPath) {
609
		Map initializations = (Map)this.containerInitializationInProgress.get();
629
		Map initializations = (Map)this.containerInitializationInProgress.get();
Lines 1144-1149 Link Here
1144
	
1164
	
1145
	public static boolean VERBOSE = false;
1165
	public static boolean VERBOSE = false;
1146
	public static boolean CP_RESOLVE_VERBOSE = false;
1166
	public static boolean CP_RESOLVE_VERBOSE = false;
1167
	public static boolean CP_RESOLVE_VERBOSE_ADVANCED = false;
1147
	public static boolean ZIP_ACCESS_VERBOSE = false;
1168
	public static boolean ZIP_ACCESS_VERBOSE = false;
1148
	
1169
	
1149
	/**
1170
	/**
Lines 1282-1287 Link Here
1282
			option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
1303
			option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
1283
			if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase(TRUE) ;
1304
			if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase(TRUE) ;
1284
1305
1306
			option = Platform.getDebugOption(CP_RESOLVE_ADVANCED_DEBUG);
1307
			if(option != null) JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED = option.equalsIgnoreCase(TRUE) ;
1308
1285
			option = Platform.getDebugOption(DELTA_DEBUG);
1309
			option = Platform.getDebugOption(DELTA_DEBUG);
1286
			if(option != null) DeltaProcessor.DEBUG = option.equalsIgnoreCase(TRUE) ;
1310
			if(option != null) DeltaProcessor.DEBUG = option.equalsIgnoreCase(TRUE) ;
1287
1311
Lines 1777-1807 Link Here
1777
			if (previousContainerValues != null){
1801
			if (previousContainerValues != null){
1778
			    IClasspathContainer previousContainer = (IClasspathContainer)previousContainerValues.get(containerPath);
1802
			    IClasspathContainer previousContainer = (IClasspathContainer)previousContainerValues.get(containerPath);
1779
			    if (previousContainer != null) {
1803
			    if (previousContainer != null) {
1780
					if (JavaModelManager.CP_RESOLVE_VERBOSE){
1804
					if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1781
						StringBuffer buffer = new StringBuffer();
1805
						verbose_reentering_project_container_access(containerPath, project, previousContainer);
1782
						buffer.append("CPContainer INIT - reentering access to project container during its initialization, will see previous value\n"); //$NON-NLS-1$ 
1783
						buffer.append("	project: " + project.getElementName() + '\n'); //$NON-NLS-1$
1784
						buffer.append("	container path: " + containerPath + '\n'); //$NON-NLS-1$
1785
						buffer.append("	previous value: "); //$NON-NLS-1$
1786
						buffer.append(previousContainer.getDescription());
1787
						buffer.append(" {\n"); //$NON-NLS-1$
1788
						IClasspathEntry[] entries = previousContainer.getClasspathEntries();
1789
						if (entries != null){
1790
							for (int j = 0; j < entries.length; j++){
1791
								buffer.append(" 		"); //$NON-NLS-1$
1792
								buffer.append(entries[j]); 
1793
								buffer.append('\n'); 
1794
							}
1795
						}
1796
						buffer.append(" 	}"); //$NON-NLS-1$
1797
						Util.verbose(buffer.toString());
1798
						new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1799
					}			    
1800
					return previousContainer;
1806
					return previousContainer;
1801
			    }
1807
			    }
1802
			}
1808
			}
1803
		    return null; // break cycle if none found
1809
		    return null; // break cycle if none found
1804
	}
1810
	}
1811
1812
	private void verbose_reentering_project_container_access(	IPath containerPath, IJavaProject project, IClasspathContainer previousContainer) {
1813
		StringBuffer buffer = new StringBuffer();
1814
		buffer.append("CPContainer INIT - reentering access to project container during its initialization, will see previous value\n"); //$NON-NLS-1$ 
1815
		buffer.append("	project: " + project.getElementName() + '\n'); //$NON-NLS-1$
1816
		buffer.append("	container path: " + containerPath + '\n'); //$NON-NLS-1$
1817
		buffer.append("	previous value: "); //$NON-NLS-1$
1818
		buffer.append(previousContainer.getDescription());
1819
		buffer.append(" {\n"); //$NON-NLS-1$
1820
		IClasspathEntry[] entries = previousContainer.getClasspathEntries();
1821
		if (entries != null){
1822
			for (int j = 0; j < entries.length; j++){
1823
				buffer.append(" 		"); //$NON-NLS-1$
1824
				buffer.append(entries[j]); 
1825
				buffer.append('\n'); 
1826
			}
1827
		}
1828
		buffer.append(" 	}"); //$NON-NLS-1$
1829
		Util.verbose(buffer.toString());
1830
		new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1831
	}
1805
	
1832
	
1806
	/**
1833
	/**
1807
	 * Returns a persisted container from previous session if any
1834
	 * Returns a persisted container from previous session if any
Lines 1809-1826 Link Here
1809
	public IPath getPreviousSessionVariable(String variableName) {
1836
	public IPath getPreviousSessionVariable(String variableName) {
1810
		IPath previousPath = (IPath)this.previousSessionVariables.get(variableName);
1837
		IPath previousPath = (IPath)this.previousSessionVariables.get(variableName);
1811
		if (previousPath != null){
1838
		if (previousPath != null){
1812
			if (CP_RESOLVE_VERBOSE){
1839
			if (CP_RESOLVE_VERBOSE_ADVANCED)
1813
				Util.verbose(
1840
				verbose_reentering_variable_access(variableName, previousPath);
1814
					"CPVariable INIT - reentering access to variable during its initialization, will see previous value\n" + //$NON-NLS-1$
1815
					"	variable: "+ variableName + '\n' + //$NON-NLS-1$
1816
					"	previous value: " + previousPath); //$NON-NLS-1$
1817
				new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1818
			}
1819
			return previousPath;
1841
			return previousPath;
1820
		}
1842
		}
1821
	    return null; // break cycle
1843
	    return null; // break cycle
1822
	}
1844
	}
1823
1845
1846
	private void verbose_reentering_variable_access(String variableName, IPath previousPath) {
1847
		Util.verbose(
1848
			"CPVariable INIT - reentering access to variable during its initialization, will see previous value\n" + //$NON-NLS-1$
1849
			"	variable: "+ variableName + '\n' + //$NON-NLS-1$
1850
			"	previous value: " + previousPath); //$NON-NLS-1$
1851
		new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1852
	}
1853
1824
	/**
1854
	/**
1825
	 * Returns the temporary cache for newly opened elements for the current thread.
1855
	 * Returns the temporary cache for newly opened elements for the current thread.
1826
	 * Creates it if not already created.
1856
	 * Creates it if not already created.
Lines 2001-2012 Link Here
2001
	 * Return the container for the given path and project.
2031
	 * Return the container for the given path and project.
2002
	 */
2032
	 */
2003
	private IClasspathContainer initializeAllContainers(IJavaProject javaProjectToInit, IPath containerToInit) throws JavaModelException {
2033
	private IClasspathContainer initializeAllContainers(IJavaProject javaProjectToInit, IPath containerToInit) throws JavaModelException {
2004
		if (CP_RESOLVE_VERBOSE) {
2034
		if (CP_RESOLVE_VERBOSE_ADVANCED)
2005
			Util.verbose(
2035
			verbose_batching_containers_initialization(javaProjectToInit, containerToInit);
2006
				"CPContainer INIT - batching containers initialization\n" + //$NON-NLS-1$
2007
				"	project to init: " + javaProjectToInit.getElementName() + '\n' + //$NON-NLS-1$
2008
				"	container path to init: " + containerToInit); //$NON-NLS-1$
2009
		}
2010
2036
2011
		// collect all container paths
2037
		// collect all container paths
2012
		final HashMap allContainerPaths = new HashMap();
2038
		final HashMap allContainerPaths = new HashMap();
Lines 2116-2135 Link Here
2116
		return containerGet(javaProjectToInit, containerToInit);
2142
		return containerGet(javaProjectToInit, containerToInit);
2117
	}
2143
	}
2118
2144
2145
	private void verbose_batching_containers_initialization(IJavaProject javaProjectToInit, IPath containerToInit) {
2146
		Util.verbose(
2147
			"CPContainer INIT - batching containers initialization\n" + //$NON-NLS-1$
2148
			"	project to init: " + javaProjectToInit.getElementName() + '\n' + //$NON-NLS-1$
2149
			"	container path to init: " + containerToInit); //$NON-NLS-1$
2150
	}
2151
2119
	IClasspathContainer initializeContainer(IJavaProject project, IPath containerPath) throws JavaModelException {
2152
	IClasspathContainer initializeContainer(IJavaProject project, IPath containerPath) throws JavaModelException {
2120
2153
2121
		IClasspathContainer container = null;
2154
		IClasspathContainer container = null;
2122
		final ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
2155
		final ClasspathContainerInitializer initializer = JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
2123
		if (initializer != null){
2156
		if (initializer != null){
2124
			if (CP_RESOLVE_VERBOSE){
2157
			if (CP_RESOLVE_VERBOSE)
2125
				Util.verbose(
2158
				verbose_triggering_container_initialization(project, containerPath, initializer);
2126
					"CPContainer INIT - triggering initialization\n" + //$NON-NLS-1$
2159
			if (CP_RESOLVE_VERBOSE_ADVANCED)
2127
					"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2160
				verbose_triggering_container_initialization_invocation_trace();
2128
					"	container path: " + containerPath + '\n' + //$NON-NLS-1$
2129
					"	initializer: " + initializer + '\n' + //$NON-NLS-1$
2130
					"	invocation stack trace:"); //$NON-NLS-1$
2131
				new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
2132
			}
2133
			PerformanceStats stats = null;
2161
			PerformanceStats stats = null;
2134
			if(JavaModelManager.PERF_CONTAINER_INITIALIZER) {
2162
			if(JavaModelManager.PERF_CONTAINER_INITIALIZER) {
2135
				stats = PerformanceStats.getStats(JavaModelManager.CONTAINER_INITIALIZER_PERF, this);
2163
				stats = PerformanceStats.getStats(JavaModelManager.CONTAINER_INITIALIZER_PERF, this);
Lines 2160-2173 Link Here
2160
					throw new JavaModelException(e);
2188
					throw new JavaModelException(e);
2161
				}
2189
				}
2162
			} catch (RuntimeException e) {
2190
			} catch (RuntimeException e) {
2163
				if (JavaModelManager.CP_RESOLVE_VERBOSE) {
2191
				if (JavaModelManager.CP_RESOLVE_VERBOSE)
2164
					e.printStackTrace();
2192
					e.printStackTrace();
2165
				}
2166
				throw e;
2193
				throw e;
2167
			} catch (Error e) {
2194
			} catch (Error e) {
2168
				if (JavaModelManager.CP_RESOLVE_VERBOSE) {
2195
				if (JavaModelManager.CP_RESOLVE_VERBOSE)
2169
					e.printStackTrace();
2196
					e.printStackTrace();
2170
				}
2171
				throw e;
2197
				throw e;
2172
			} finally {
2198
			} finally {
2173
				if(JavaModelManager.PERF_CONTAINER_INITIALIZER) {
2199
				if(JavaModelManager.PERF_CONTAINER_INITIALIZER) {
Lines 2177-2228 Link Here
2177
					// just remove initialization in progress and keep previous session container so as to avoid a full build
2203
					// just remove initialization in progress and keep previous session container so as to avoid a full build
2178
					// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=92588
2204
					// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=92588
2179
					containerRemoveInitializationInProgress(project, containerPath); 
2205
					containerRemoveInitializationInProgress(project, containerPath); 
2180
					if (CP_RESOLVE_VERBOSE) {
2206
					if (CP_RESOLVE_VERBOSE) 
2181
						if (container == CONTAINER_INITIALIZATION_IN_PROGRESS) {
2207
						verbose_container_initialization_failed(project, containerPath, container, initializer);
2182
							Util.verbose(
2183
								"CPContainer INIT - FAILED (initializer did not initialize container)\n" + //$NON-NLS-1$
2184
								"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2185
								"	container path: " + containerPath + '\n' + //$NON-NLS-1$
2186
								"	initializer: " + initializer); //$NON-NLS-1$
2187
							
2188
						} else {
2189
							Util.verbose(
2190
								"CPContainer INIT - FAILED (see exception above)\n" + //$NON-NLS-1$
2191
								"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2192
								"	container path: " + containerPath + '\n' + //$NON-NLS-1$
2193
								"	initializer: " + initializer); //$NON-NLS-1$
2194
						}
2195
					}
2196
				}
2208
				}
2197
			}
2209
			}
2198
			if (CP_RESOLVE_VERBOSE){
2210
			if (CP_RESOLVE_VERBOSE_ADVANCED)
2199
				StringBuffer buffer = new StringBuffer();
2211
				verbose_container_value_after_initialization(project, containerPath, container);
2200
				buffer.append("CPContainer INIT - after resolution\n"); //$NON-NLS-1$
2212
		} else {
2201
				buffer.append("	project: " + project.getElementName() + '\n'); //$NON-NLS-1$
2213
			if (CP_RESOLVE_VERBOSE_ADVANCED)
2202
				buffer.append("	container path: " + containerPath + '\n'); //$NON-NLS-1$
2214
				verbose_no_container_initializer_found(project, containerPath);
2203
				if (container != null){
2215
		}
2204
					buffer.append("	container: "+container.getDescription()+" {\n"); //$NON-NLS-2$//$NON-NLS-1$
2216
		return container;
2205
					IClasspathEntry[] entries = container.getClasspathEntries();
2217
	}
2206
					if (entries != null){
2218
2207
						for (int i = 0; i < entries.length; i++){
2219
	private void verbose_no_container_initializer_found(IJavaProject project, IPath containerPath) {
2208
							buffer.append("		" + entries[i] + '\n'); //$NON-NLS-1$
2220
		Util.verbose(
2209
						}
2221
			"CPContainer INIT - no initializer found\n" + //$NON-NLS-1$
2210
					}
2222
			"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2211
					buffer.append("	}");//$NON-NLS-1$
2223
			"	container path: " + containerPath); //$NON-NLS-1$
2212
				} else {
2224
	}
2213
					buffer.append("	container: {unbound}");//$NON-NLS-1$
2225
2226
	private void verbose_container_value_after_initialization(IJavaProject project, IPath containerPath, IClasspathContainer container) {
2227
		StringBuffer buffer = new StringBuffer();
2228
		buffer.append("CPContainer INIT - after resolution\n"); //$NON-NLS-1$
2229
		buffer.append("	project: " + project.getElementName() + '\n'); //$NON-NLS-1$
2230
		buffer.append("	container path: " + containerPath + '\n'); //$NON-NLS-1$
2231
		if (container != null){
2232
			buffer.append("	container: "+container.getDescription()+" {\n"); //$NON-NLS-2$//$NON-NLS-1$
2233
			IClasspathEntry[] entries = container.getClasspathEntries();
2234
			if (entries != null){
2235
				for (int i = 0; i < entries.length; i++){
2236
					buffer.append("		" + entries[i] + '\n'); //$NON-NLS-1$
2214
				}
2237
				}
2215
				Util.verbose(buffer.toString());
2216
			}
2238
			}
2239
			buffer.append("	}");//$NON-NLS-1$
2217
		} else {
2240
		} else {
2218
			if (CP_RESOLVE_VERBOSE){
2241
			buffer.append("	container: {unbound}");//$NON-NLS-1$
2219
				Util.verbose(
2220
					"CPContainer INIT - no initializer found\n" + //$NON-NLS-1$
2221
					"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2222
					"	container path: " + containerPath); //$NON-NLS-1$
2223
			}
2224
		}
2242
		}
2225
		return container;
2243
		Util.verbose(buffer.toString());
2244
	}
2245
2246
	private void verbose_container_initialization_failed(IJavaProject project, IPath containerPath, IClasspathContainer container, ClasspathContainerInitializer initializer) {
2247
		if (container == CONTAINER_INITIALIZATION_IN_PROGRESS) {
2248
			Util.verbose(
2249
				"CPContainer INIT - FAILED (initializer did not initialize container)\n" + //$NON-NLS-1$
2250
				"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2251
				"	container path: " + containerPath + '\n' + //$NON-NLS-1$
2252
				"	initializer: " + initializer); //$NON-NLS-1$
2253
			
2254
		} else {
2255
			Util.verbose(
2256
				"CPContainer INIT - FAILED (see exception above)\n" + //$NON-NLS-1$
2257
				"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2258
				"	container path: " + containerPath + '\n' + //$NON-NLS-1$
2259
				"	initializer: " + initializer); //$NON-NLS-1$
2260
		}
2261
	}
2262
2263
	private void verbose_triggering_container_initialization(IJavaProject project, IPath containerPath,  ClasspathContainerInitializer initializer) {
2264
		Util.verbose(
2265
			"CPContainer INIT - triggering initialization\n" + //$NON-NLS-1$
2266
			"	project: " + project.getElementName() + '\n' + //$NON-NLS-1$
2267
			"	container path: " + containerPath + '\n' + //$NON-NLS-1$
2268
			"	initializer: " + initializer); //$NON-NLS-1$
2269
	}
2270
	
2271
	private void verbose_triggering_container_initialization_invocation_trace() {
2272
		Util.verbose(
2273
			"CPContainer INIT - triggering initialization\n" + //$NON-NLS-1$
2274
			"	invocation trace:"); //$NON-NLS-1$
2275
		new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
2226
	}
2276
	}
2227
2277
2228
	/**
2278
	/**
(-)model/org/eclipse/jdt/core/JavaCore.java (-49 / +78 lines)
Lines 1601-1627 Link Here
1601
			for(int i = 0; i < extensions.length; i++){
1601
			for(int i = 0; i < extensions.length; i++){
1602
				IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
1602
				IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
1603
				for(int j = 0; j < configElements.length; j++){
1603
				for(int j = 0; j < configElements.length; j++){
1604
					String initializerID = configElements[j].getAttribute("id"); //$NON-NLS-1$
1604
					IConfigurationElement configurationElement = configElements[j];
1605
					String initializerID = configurationElement.getAttribute("id"); //$NON-NLS-1$
1605
					if (initializerID != null && initializerID.equals(containerID)){
1606
					if (initializerID != null && initializerID.equals(containerID)){
1606
						if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1607
						if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1607
							Util.verbose(
1608
							verbose_found_container_initializer(containerID, configurationElement);
1608
								"CPContainer INIT - found initializer\n" + //$NON-NLS-1$
1609
								"	container ID: " + containerID + '\n' + //$NON-NLS-1$
1610
								"	class: " + configElements[j].getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$
1611
						}
1612
						try {
1609
						try {
1613
							Object execExt = configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
1610
							Object execExt = configurationElement.createExecutableExtension("class"); //$NON-NLS-1$
1614
							if (execExt instanceof ClasspathContainerInitializer){
1611
							if (execExt instanceof ClasspathContainerInitializer){
1615
								return (ClasspathContainerInitializer)execExt;
1612
								return (ClasspathContainerInitializer)execExt;
1616
							}
1613
							}
1617
						} catch(CoreException e) {
1614
						} catch(CoreException e) {
1618
							// executable extension could not be created: ignore this initializer
1615
							// executable extension could not be created: ignore this initializer
1619
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1616
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1620
								Util.verbose(
1617
								verbose_failed_to_instanciate_container_initializer(containerID, configurationElement);
1621
									"CPContainer INIT - failed to instanciate initializer\n" + //$NON-NLS-1$
1622
									"	container ID: " + containerID + '\n' + //$NON-NLS-1$
1623
									"	class: " + configElements[j].getAttribute("class"), //$NON-NLS-1$ //$NON-NLS-2$
1624
									System.err);
1625
								e.printStackTrace();
1618
								e.printStackTrace();
1626
							}
1619
							}
1627
						}
1620
						}
Lines 1632-1637 Link Here
1632
		return null;
1625
		return null;
1633
	}
1626
	}
1634
1627
1628
	private static void verbose_failed_to_instanciate_container_initializer(String containerID, IConfigurationElement configurationElement) {
1629
		Util.verbose(
1630
			"CPContainer INIT - failed to instanciate initializer\n" + //$NON-NLS-1$
1631
			"	container ID: " + containerID + '\n' + //$NON-NLS-1$
1632
			"	class: " + configurationElement.getAttribute("class"), //$NON-NLS-1$ //$NON-NLS-2$
1633
			System.err);
1634
	}
1635
1636
	private static void verbose_found_container_initializer(String containerID, IConfigurationElement configurationElement) {
1637
		Util.verbose(
1638
			"CPContainer INIT - found initializer\n" + //$NON-NLS-1$
1639
			"	container ID: " + containerID + '\n' + //$NON-NLS-1$
1640
			"	class: " + configurationElement.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$
1641
	}
1642
1635
	/**
1643
	/**
1636
	 * Returns the path held in the given classpath variable.
1644
	 * Returns the path held in the given classpath variable.
1637
	 * Returns <code>null</code> if unable to bind.
1645
	 * Returns <code>null</code> if unable to bind.
Lines 1666-1679 Link Here
1666
		// even if persisted value exists, initializer is given priority, only if no initializer is found the persisted value is reused
1674
		// even if persisted value exists, initializer is given priority, only if no initializer is found the persisted value is reused
1667
		final ClasspathVariableInitializer initializer = JavaCore.getClasspathVariableInitializer(variableName);
1675
		final ClasspathVariableInitializer initializer = JavaCore.getClasspathVariableInitializer(variableName);
1668
		if (initializer != null){
1676
		if (initializer != null){
1669
			if (JavaModelManager.CP_RESOLVE_VERBOSE){
1677
			if (JavaModelManager.CP_RESOLVE_VERBOSE)
1670
				Util.verbose(
1678
				verbose_triggering_variable_initialization(variableName, initializer);
1671
					"CPVariable INIT - triggering initialization\n" + //$NON-NLS-1$
1679
			if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1672
					"	variable: " + variableName + '\n' + //$NON-NLS-1$
1680
				verbose_triggering_variable_initialization_invocation_trace();
1673
					"	initializer: " + initializer + '\n' + //$NON-NLS-1$
1674
					"	invocation stack trace:"); //$NON-NLS-1$
1675
				new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1676
			}
1677
			manager.variablePut(variableName, JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS); // avoid initialization cycles
1681
			manager.variablePut(variableName, JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS); // avoid initialization cycles
1678
			boolean ok = false;
1682
			boolean ok = false;
1679
			try {
1683
			try {
Lines 1683-1719 Link Here
1683
1687
1684
				variablePath = manager.variableGet(variableName); // initializer should have performed side-effect
1688
				variablePath = manager.variableGet(variableName); // initializer should have performed side-effect
1685
				if (variablePath == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS) return null; // break cycle (initializer did not init or reentering call)
1689
				if (variablePath == JavaModelManager.VARIABLE_INITIALIZATION_IN_PROGRESS) return null; // break cycle (initializer did not init or reentering call)
1686
				if (JavaModelManager.CP_RESOLVE_VERBOSE){
1690
				if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1687
					Util.verbose(
1691
					verbose_variable_value_after_initialization(variableName, variablePath);
1688
						"CPVariable INIT - after initialization\n" + //$NON-NLS-1$
1689
						"	variable: " + variableName +'\n' + //$NON-NLS-1$
1690
						"	variable path: " + variablePath); //$NON-NLS-1$
1691
				}
1692
				manager.variablesWithInitializer.add(variableName);
1692
				manager.variablesWithInitializer.add(variableName);
1693
				ok = true;
1693
				ok = true;
1694
			} catch (RuntimeException e) {
1694
			} catch (RuntimeException e) {
1695
				if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1695
				if (JavaModelManager.CP_RESOLVE_VERBOSE)
1696
					e.printStackTrace();
1696
					e.printStackTrace();
1697
				}
1698
				throw e;
1697
				throw e;
1699
			} catch (Error e) {
1698
			} catch (Error e) {
1700
				if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1699
				if (JavaModelManager.CP_RESOLVE_VERBOSE)
1701
					e.printStackTrace();
1700
					e.printStackTrace();
1702
				}
1703
				throw e;
1701
				throw e;
1704
			} finally {
1702
			} finally {
1705
				if (!ok) JavaModelManager.getJavaModelManager().variablePut(variableName, null); // flush cache
1703
				if (!ok) JavaModelManager.getJavaModelManager().variablePut(variableName, null); // flush cache
1706
			}
1704
			}
1707
		} else {
1705
		} else {
1708
			if (JavaModelManager.CP_RESOLVE_VERBOSE){
1706
			if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1709
				Util.verbose(
1707
				verbose_no_variable_initializer_found(variableName);
1710
					"CPVariable INIT - no initializer found\n" + //$NON-NLS-1$
1711
					"	variable: " + variableName); //$NON-NLS-1$
1712
			}
1713
		}
1708
		}
1714
		return variablePath;
1709
		return variablePath;
1715
	}
1710
	}
1716
1711
1712
	private static void verbose_no_variable_initializer_found(String variableName) {
1713
		Util.verbose(
1714
			"CPVariable INIT - no initializer found\n" + //$NON-NLS-1$
1715
			"	variable: " + variableName); //$NON-NLS-1$
1716
	}
1717
1718
	private static void verbose_variable_value_after_initialization(String variableName, IPath variablePath) {
1719
		Util.verbose(
1720
			"CPVariable INIT - after initialization\n" + //$NON-NLS-1$
1721
			"	variable: " + variableName +'\n' + //$NON-NLS-1$
1722
			"	variable path: " + variablePath); //$NON-NLS-1$
1723
	}
1724
1725
	private static void verbose_triggering_variable_initialization(String variableName, ClasspathVariableInitializer initializer) {
1726
		Util.verbose(
1727
			"CPVariable INIT - triggering initialization\n" + //$NON-NLS-1$
1728
			"	variable: " + variableName + '\n' + //$NON-NLS-1$
1729
			"	initializer: " + initializer); //$NON-NLS-1$
1730
	}
1731
1732
	private static void verbose_triggering_variable_initialization_invocation_trace() {
1733
		Util.verbose(
1734
			"CPVariable INIT - triggering initialization\n" + //$NON-NLS-1$
1735
			"	invocation trace:"); //$NON-NLS-1$
1736
		new Exception("<Fake exception>").printStackTrace(System.out); //$NON-NLS-1$
1737
	}
1738
1717
	/**
1739
	/**
1718
	 * Returns deprecation message of a given classpath variable.
1740
	 * Returns deprecation message of a given classpath variable.
1719
	 *
1741
	 *
Lines 1746-1762 Link Here
1746
			for(int i = 0; i < extensions.length; i++){
1768
			for(int i = 0; i < extensions.length; i++){
1747
				IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
1769
				IConfigurationElement [] configElements = extensions[i].getConfigurationElements();
1748
				for(int j = 0; j < configElements.length; j++){
1770
				for(int j = 0; j < configElements.length; j++){
1771
					IConfigurationElement configElement = configElements[j];
1749
					try {
1772
					try {
1750
						IConfigurationElement configElement = configElements[j];
1751
						String varAttribute = configElement.getAttribute("variable"); //$NON-NLS-1$
1773
						String varAttribute = configElement.getAttribute("variable"); //$NON-NLS-1$
1752
						if (variable.equals(varAttribute)) {
1774
						if (variable.equals(varAttribute)) {
1753
							if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1775
							if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
1754
								Util.verbose(
1776
								verbose_found_variable_initializer(variable, configElement);
1755
									"CPVariable INIT - found initializer\n" + //$NON-NLS-1$
1777
							Object execExt = configElement.createExecutableExtension("class"); //$NON-NLS-1$
1756
									"	variable: " + variable + '\n' + //$NON-NLS-1$
1757
									"	class: " + configElements[j].getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$
1758
							}
1759
							Object execExt = configElements[j].createExecutableExtension("class"); //$NON-NLS-1$
1760
							if (execExt instanceof ClasspathVariableInitializer){
1778
							if (execExt instanceof ClasspathVariableInitializer){
1761
								ClasspathVariableInitializer initializer = (ClasspathVariableInitializer)execExt;
1779
								ClasspathVariableInitializer initializer = (ClasspathVariableInitializer)execExt;
1762
								String deprecatedAttribute = configElement.getAttribute("deprecated"); //$NON-NLS-1$
1780
								String deprecatedAttribute = configElement.getAttribute("deprecated"); //$NON-NLS-1$
Lines 1773-1783 Link Here
1773
					} catch(CoreException e){
1791
					} catch(CoreException e){
1774
						// executable extension could not be created: ignore this initializer
1792
						// executable extension could not be created: ignore this initializer
1775
						if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1793
						if (JavaModelManager.CP_RESOLVE_VERBOSE) {
1776
							Util.verbose(
1794
							verbose_failed_to_instanciate_variable_initializer(variable, configElement);
1777
								"CPContainer INIT - failed to instanciate initializer\n" + //$NON-NLS-1$
1778
								"	variable: " + variable + '\n' + //$NON-NLS-1$
1779
								"	class: " + configElements[j].getAttribute("class"), //$NON-NLS-1$ //$NON-NLS-2$
1780
								System.err);
1781
							e.printStackTrace();
1795
							e.printStackTrace();
1782
						}
1796
						}
1783
					}
1797
					}
Lines 1787-1792 Link Here
1787
		return null;
1801
		return null;
1788
	}
1802
	}
1789
1803
1804
	private static void verbose_failed_to_instanciate_variable_initializer(String variable, IConfigurationElement configElement) {
1805
		Util.verbose(
1806
			"CPContainer INIT - failed to instanciate initializer\n" + //$NON-NLS-1$
1807
			"	variable: " + variable + '\n' + //$NON-NLS-1$
1808
			"	class: " + configElement.getAttribute("class"), //$NON-NLS-1$ //$NON-NLS-2$
1809
			System.err);
1810
	}
1811
1812
	private static void verbose_found_variable_initializer(String variable, IConfigurationElement configElement) {
1813
		Util.verbose(
1814
			"CPVariable INIT - found initializer\n" + //$NON-NLS-1$
1815
			"	variable: " + variable + '\n' + //$NON-NLS-1$
1816
			"	class: " + configElement.getAttribute("class")); //$NON-NLS-1$ //$NON-NLS-2$
1817
	}
1818
1790
	/**
1819
	/**
1791
	 * Returns the names of all known classpath variables.
1820
	 * Returns the names of all known classpath variables.
1792
	 * <p>
1821
	 * <p>
(-).options (+3 lines)
Lines 16-21 Link Here
16
# Reports classpath variable initialization, and classpath container resolution
16
# Reports classpath variable initialization, and classpath container resolution
17
org.eclipse.jdt.core/debug/cpresolution=false
17
org.eclipse.jdt.core/debug/cpresolution=false
18
18
19
# Reports internals of classpath variable initialization, and classpath container resolution (to be used on the JDT/Core team request only)
20
org.eclipse.jdt.core/debug/cpresolution/advanced=false
21
19
# Report type hierarchy connections, refreshes and deltas
22
# Report type hierarchy connections, refreshes and deltas
20
org.eclipse.jdt.core/debug/hierarchy=false
23
org.eclipse.jdt.core/debug/hierarchy=false
21
24

Return to bug 178039