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 |
/** |