Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 59863 Details for
Bug 172345
[model][delta] path error markers are not regenerated on project rebuild
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Additional patch to fix problem with workspace preferences
v03.txt (text/plain), 82.34 KB, created by
Frederic Fusier
on 2007-02-27 07:03:28 EST
(
hide
)
Description:
Additional patch to fix problem with workspace preferences
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-02-27 07:03:28 EST
Size:
82.34 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.builder >Index: src/org/eclipse/jdt/core/tests/builder/BuilderTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuilderTests.java,v >retrieving revision 1.6 >diff -u -r1.6 BuilderTests.java >--- src/org/eclipse/jdt/core/tests/builder/BuilderTests.java 21 Feb 2007 09:51:38 -0000 1.6 >+++ src/org/eclipse/jdt/core/tests/builder/BuilderTests.java 27 Feb 2007 11:52:01 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.core.tests.builder; > >+import java.util.Arrays; > import java.util.Enumeration; > import java.util.Hashtable; > import java.util.Vector; >@@ -192,14 +193,15 @@ > /** Verifies that the given elements have no problems. > */ > protected void expectingNoProblemsFor(IPath[] roots) { >- if (DEBUG) >- printProblemsFor(roots); >- >- for (int i = 0; i < roots.length; i++) { >- Problem[] problems = env.getProblemsFor(roots[i]); >- if (problems.length != 0) >- assertTrue("unexpected problem(s) : " + problems[0], false); //$NON-NLS-1$ >+ StringBuffer buffer = new StringBuffer(); >+ Problem[] allProblems = allSortedProblems(roots); >+ if (allProblems != null) { >+ for (int i=0, length=allProblems.length; i<length; i++) { >+ buffer.append(allProblems[i]+"\n"); >+ } > } >+ String actual = buffer.toString(); >+ assumeEquals("Unexpected problem(s)!!!", "", actual); //$NON-NLS-1$ > } > > /** Verifies that the given element has problems and >@@ -284,21 +286,23 @@ > > /** Verifies that the given element has problems. > */ >- protected void expectingProblemsFor(IPath expected) { >- expectingProblemsFor(new IPath[] { expected }); >+ protected void expectingProblemsFor(IPath root, String expected) { >+ expectingProblemsFor(new IPath[] { root }, expected); > } > > /** Verifies that the given elements have problems. > */ >- protected void expectingProblemsFor(IPath[] expected) { >- if (DEBUG) >- printProblemsFor(expected); >- >- for (int i = 0; i < expected.length; i++) { >- /* get the leaf problems for this type */ >- Problem[] problems = env.getProblemsFor(expected[i]); >- assertTrue("missing expected problem with " + expected[i].toString(), problems.length > 0); //$NON-NLS-1$ >+ protected void expectingProblemsFor(IPath[] roots, String expected) { >+ StringBuffer buffer = new StringBuffer(); >+ Problem[] allProblems = allSortedProblems(roots); >+ if (allProblems != null) { >+ for (int i=0, length=allProblems.length; i<length; i++) { >+ if (i>0) buffer.append('\n'); >+ buffer.append(allProblems[i]); >+ } > } >+ String actual = buffer.toString(); >+ assumeEquals("Invalid problem(s)!!!", expected, actual); //$NON-NLS-1$ > } > > /** Verifies that the given element has a specific problem. >@@ -325,10 +329,6 @@ > } > } > } >- System.out.println("--------------------------------------------------------------------------------"); >- System.out.println("Missing problem while running test "+getName()+":"); >- System.out.println(" - expected : " + problem); >- System.out.println(" - current: " + problemsToString(rootProblems)); > /* > for (int j = 0; j < rootProblems.length; j++) { > Problem pb = rootProblems[j]; >@@ -339,6 +339,10 @@ > } > } > */ >+ System.out.println("--------------------------------------------------------------------------------"); >+ System.out.println("Missing problem while running test "+getName()+":"); >+ System.out.println(" - expected : " + problem); >+ System.out.println(" - current: " + problemsToString(rootProblems)); > assumeTrue("missing expected problem: " + problem, false); > } > } >@@ -429,6 +433,33 @@ > super.tearDown(); > } > >+ /** >+ * Concatenate and sort all problems for given root paths. >+ * >+ * @param roots The path to get the problems >+ * @return All sorted problems of all given path >+ */ >+ Problem[] allSortedProblems(IPath[] roots) { >+ Problem[] allProblems = null; >+ for (int i = 0, max=roots.length; i<max; i++) { >+ Problem[] problems = env.getProblemsFor(roots[i]); >+ int length = problems.length; >+ if (problems.length != 0) { >+ if (allProblems == null) { >+ allProblems = problems; >+ } else { >+ int all = allProblems.length; >+ System.arraycopy(allProblems, 0, allProblems = new Problem[all+length], 0, all); >+ System.arraycopy(problems, 0, allProblems , all, length); >+ } >+ } >+ } >+ if (allProblems != null) { >+ Arrays.sort(allProblems); >+ } >+ return allProblems; >+ } >+ > public static Test suite() { > TestSuite suite = new TestSuite(); > >Index: src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java,v >retrieving revision 1.31 >diff -u -r1.31 IncrementalTests.java >--- src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java 2 Feb 2007 17:28:57 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/builder/IncrementalTests.java 27 Feb 2007 11:52:02 -0000 >@@ -57,7 +57,10 @@ > "class CC {}"); > > incrementalBuild(projectPath); >- expectingProblemsFor(new IPath[]{ pathToD }); >+ expectingProblemsFor( >+ pathToD, >+ "Problem : The type CC is already defined [ resource : </Project/src/p/D.java> range : <37,39> category : <-1> severity : <2>]" >+ ); > expectingSpecificProblemsFor(pathToD, new Problem[] {new Problem("", "The type CC is already defined", pathToD, 37, 39, -1, IMarker.SEVERITY_ERROR)}); > } > >@@ -183,7 +186,12 @@ > "public class C extends B { }"); //$NON-NLS-1$ > > incrementalBuild(projectPath); >- expectingProblemsFor(new IPath[]{ pathToA, pathToB, pathToC }); >+ expectingProblemsFor( >+ new IPath[]{ pathToA, pathToB, pathToC }, >+ "Problem : The public type _A must be defined in its own file [ resource : </Project/src/p/A.java> range : <25,27> category : <40> severity : <2>]\n" + >+ "Problem : A cannot be resolved to a type [ resource : </Project/src/p/B.java> range : <35,36> category : <40> severity : <2>]\n" + >+ "Problem : The hierarchy of the type C is inconsistent [ resource : </Project/src/p/C.java> range : <25,26> category : <40> severity : <2>]" >+ ); > expectingSpecificProblemFor(pathToA, new Problem("_A", "The public type _A must be defined in its own file", pathToA, 25, 27, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ > expectingSpecificProblemFor(pathToB, new Problem("B", "A cannot be resolved to a type", pathToB, 35, 36, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ > expectingSpecificProblemFor(pathToC, new Problem("C", "The hierarchy of the type C is inconsistent", pathToC, 25, 26, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >@@ -252,7 +260,10 @@ > "}"); //$NON-NLS-1$ > > incrementalBuild(projectPath); >- expectingProblemsFor(new IPath[]{ pathToAB }); >+ expectingProblemsFor( >+ pathToAB, >+ "Problem : AZ cannot be resolved to a type [ resource : </Project/src/p/AB.java> range : <36,38> category : <40> severity : <2>]" >+ ); > expectingSpecificProblemFor(pathToAB, new Problem("AB", "AZ cannot be resolved to a type", pathToAB, 36, 38, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ > > env.addClass(root, "p", "AA", //$NON-NLS-1$ //$NON-NLS-2$ >@@ -319,7 +330,10 @@ > "}"); //$NON-NLS-1$ > > incrementalBuild(projectPath); >- expectingProblemsFor(new IPath[]{ pathToBB }); >+ expectingProblemsFor( >+ pathToBB, >+ "Problem : ZA cannot be resolved to a type [ resource : </Project/src/p/BB.java> range : <104,106> category : <40> severity : <2>]" >+ ); > expectingSpecificProblemFor(pathToBB, new Problem("BB.foo()", "ZA cannot be resolved to a type", pathToBB, 104, 106, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ > > env.addClass(root, "p", "ZZ", //$NON-NLS-1$ //$NON-NLS-2$ >@@ -619,7 +633,7 @@ > ); > > incrementalBuild(); >- expectingProblemsFor(x); >+ expectingProblemsFor(x, "???"); > expectingNoPresenceOf(bin.append("X.class")); //$NON-NLS-1$ > } > >Index: src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java,v >retrieving revision 1.23 >diff -u -r1.23 BasicBuildTests.java >--- src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java 2 Feb 2007 17:28:57 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/builder/BasicBuildTests.java 27 Feb 2007 11:52:01 -0000 >@@ -19,10 +19,13 @@ > import org.eclipse.core.resources.IMarker; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences; > import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.core.JavaCore; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.compiler.CategorizedProblem; > import org.eclipse.jdt.core.tests.util.Util; >+import org.eclipse.jdt.internal.core.JavaModelManager; > > /** > * Basic tests of the image builder. >@@ -417,4 +420,94 @@ > fullBuild(projectPath); > expectingNoProblems(); > } >+ >+ /** >+ * @bug 75471: [prefs] no re-compile when loading settings >+ * @test Ensure that changing project preferences is well taking into account while rebuilding project >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=75471" >+ */ >+ public void _testUpdateProjectPreferences() throws JavaModelException { >+ >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ >+ // remove old package fragment root so that names don't collide >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ >+ env.addClass(root, "util", "MyException", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package util;\n" + >+ "public class MyException extends Exception {\n" + >+ " private static final long serialVersionUID = 1L;\n" + >+ "}" >+ ); //$NON-NLS-1$ >+ >+ IPath cuPath = env.addClass(root, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;\n" + >+ "import util.MyException;\n" + >+ "public class Test {\n" + >+ "}" >+ ); >+ >+ fullBuild(projectPath); >+ expectingSpecificProblemFor( >+ projectPath, >+ new Problem("", "The import util.MyException is never used", cuPath, 18, 34, CategorizedProblem.CAT_UNNECESSARY_CODE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ IJavaProject project = env.getJavaProject(projectPath); >+ project.setOption(JavaCore.COMPILER_PB_UNUSED_IMPORT, JavaCore.IGNORE); >+ incrementalBuild(projectPath); >+ expectingNoProblems(); >+ } >+ public void _testUpdateWkspPreferences() throws JavaModelException { >+ >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ >+ // remove old package fragment root so that names don't collide >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ >+ env.addClass(root, "util", "MyException", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package util;\n" + >+ "public class MyException extends Exception {\n" + >+ " private static final long serialVersionUID = 1L;\n" + >+ "}" >+ ); //$NON-NLS-1$ >+ >+ IPath cuPath = env.addClass(root, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;\n" + >+ "import util.MyException;\n" + >+ "public class Test {\n" + >+ "}" >+ ); >+ >+ fullBuild(); >+ expectingSpecificProblemFor( >+ projectPath, >+ new Problem("", "The import util.MyException is never used", cuPath, 18, 34, CategorizedProblem.CAT_UNNECESSARY_CODE, IMarker.SEVERITY_WARNING)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ // Save preference >+ JavaModelManager manager = JavaModelManager.getJavaModelManager(); >+ IEclipsePreferences preferences = manager.getInstancePreferences(); >+ String unusedImport = preferences.get(JavaCore.COMPILER_PB_UNUSED_IMPORT, null); >+ try { >+ // Modify preference >+ preferences.put(JavaCore.COMPILER_PB_UNUSED_IMPORT, JavaCore.IGNORE); >+ incrementalBuild(); >+ expectingNoProblems(); >+ } >+ finally { >+ if (unusedImport == null) { >+ preferences.remove(JavaCore.COMPILER_PB_UNUSED_IMPORT); >+ } else { >+ preferences.put(JavaCore.COMPILER_PB_UNUSED_IMPORT, unusedImport); >+ } >+ } >+ } >+ > } >Index: src/org/eclipse/jdt/core/tests/builder/DependencyTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/DependencyTests.java,v >retrieving revision 1.23 >diff -u -r1.23 DependencyTests.java >--- src/org/eclipse/jdt/core/tests/builder/DependencyTests.java 2 Feb 2007 17:28:57 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/builder/DependencyTests.java 27 Feb 2007 11:52:02 -0000 >@@ -268,7 +268,10 @@ > > // build -> expecting problems > fullBuild(); >- expectingProblemsFor(classTest); >+ expectingProblemsFor( >+ classTest, >+ "Problem : The method bar() is undefined for the type Y [ resource : </Project/p/X.java> range : <57,60> category : <50> severity : <2>]" >+ ); > > try { > Thread.sleep(1000); >Index: src/org/eclipse/jdt/core/tests/builder/Java50Tests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/Java50Tests.java,v >retrieving revision 1.6 >diff -u -r1.6 Java50Tests.java >--- src/org/eclipse/jdt/core/tests/builder/Java50Tests.java 29 Mar 2006 03:16:23 -0000 1.6 >+++ src/org/eclipse/jdt/core/tests/builder/Java50Tests.java 27 Feb 2007 11:52:02 -0000 >@@ -54,7 +54,10 @@ > ); > > incrementalBuild(projectPath); >- expectingProblemsFor(usePath); >+ expectingProblemsFor( >+ usePath, >+ "Problem : The annotation @Ann is disallowed for this location [ resource : </Project/p/Use.java> range : <11,17> category : <40> severity : <2>]" >+ ); > } > > public void testParameterizedType1() throws JavaModelException { >@@ -92,7 +95,10 @@ > ); > > incrementalBuild(projectPath); >- expectingProblemsFor(usePath); >+ expectingProblemsFor( >+ usePath, >+ "Problem : The method foo(List<Object>) in the type Other is not applicable for the arguments (ArrayList<String>) [ resource : </Project/p/Use.java> range : <104,107> category : <50> severity : <2>]" >+ ); > } > > public void testParameterizedType2() throws JavaModelException { >@@ -130,7 +136,10 @@ > ); > > incrementalBuild(projectPath); >- expectingProblemsFor(usePath); >+ expectingProblemsFor( >+ usePath, >+ "Problem : Unhandled exception type Exception [ resource : </Project/p/Use.java> range : <92,132> category : <40> severity : <2>]" >+ ); > } > > } >Index: src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java,v >retrieving revision 1.35 >diff -u -r1.35 BuildpathTests.java >--- src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java 21 Feb 2007 09:51:38 -0000 1.35 >+++ src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java 27 Feb 2007 11:52:01 -0000 >@@ -15,6 +15,7 @@ > import org.eclipse.core.resources.IMarker; > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.*; >+import org.eclipse.core.runtime.preferences.IEclipsePreferences; > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.compiler.CategorizedProblem; > import org.eclipse.jdt.core.tests.util.AbstractCompilerTest; >@@ -28,442 +29,464 @@ > > public class BuildpathTests extends BuilderTests { > >- public BuildpathTests(String name) { >- super(name); >- } >- >- public static Test suite() { >- return buildTestSuite(BuildpathTests.class); >- } >- public void testClasspathFileChange() throws JavaModelException { >- // create project with src folder, and alternate unused src2 folder >- IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >- env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >- IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >- env.addExternalJars(projectPath, Util.getJavaClassLibs()); >- env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >- IPath classTest1 = env.addClass(root, "p1", "Test1", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p1;\n"+ //$NON-NLS-1$ >- "public class Test1 extends Zork1 {}" //$NON-NLS-1$ >- ); >- // not yet on the classpath >- IPath src2Path = env.addFolder(projectPath, "src2"); //$NON-NLS-1$ >- IPath src2p1Path = env.addFolder(src2Path, "p1"); //$NON-NLS-1$ >- env.addFile(src2p1Path, "Zork1.java", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p1;\n"+ //$NON-NLS-1$ >- "public class Zork1 {}" //$NON-NLS-1$ >- ); >- >- fullBuild(); >- expectingSpecificProblemFor(classTest1, new Problem("src", "Zork1 cannot be resolved to a type", classTest1,39, 44, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+public BuildpathTests(String name) { >+ super(name); >+} > >- //---------------------------- >- // Step 2 >- //---------------------------- >- StringBuffer buffer = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); //$NON-NLS-1$ >- buffer.append("<classpath>\n"); //$NON-NLS-1$ >- buffer.append(" <classpathentry kind=\"src\" path=\"src\"/>\n"); //$NON-NLS-1$ >- buffer.append(" <classpathentry kind=\"src\" path=\"src2\"/>\n"); // add src2 on classpath through resource change //$NON-NLS-1$ >- String[] classlibs = Util.getJavaClassLibs(); >- for (int i = 0; i < classlibs.length; i++) { >- buffer.append(" <classpathentry kind=\"lib\" path=\"").append(classlibs[i]).append("\"/>\n"); //$NON-NLS-1$ //$NON-NLS-2$ >- } >- buffer.append(" <classpathentry kind=\"output\" path=\"bin\"/>\n"); //$NON-NLS-1$ >- buffer.append("</classpath>"); //$NON-NLS-1$ >- boolean wasAutoBuilding = env.isAutoBuilding(); >- try { >- // turn autobuild on >- env.setAutoBuilding(true); >- // write new .classpath, will trigger autobuild >- env.addFile(projectPath, ".classpath", buffer.toString()); //$NON-NLS-1$ >- // ensures the builder did see the classpath change >- env.waitForAutoBuild(); >- expectingNoProblems(); >- } finally { >- env.setAutoBuilding(wasAutoBuilding); >- } >- } >+public static Test suite() { >+ return buildTestSuite(BuildpathTests.class); >+} > >- public void testClosedProject() throws JavaModelException { >- IPath project1Path = env.addProject("CP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >- IPath jarPath = env.addInternalJar(project1Path, "temp.jar", new byte[] {0}); //$NON-NLS-1$ >- >- IPath project2Path = env.addProject("CP2"); //$NON-NLS-1$ >- env.addExternalJars(project2Path, Util.getJavaClassLibs()); >- env.addRequiredProject(project2Path, project1Path); >- >- IPath project3Path = env.addProject("CP3"); //$NON-NLS-1$ >- env.addExternalJars(project3Path, Util.getJavaClassLibs()); >- env.addExternalJar(project3Path, jarPath.toString()); >+private String getJdkLevelProblem(String expectedRuntime, String path, int severity) { >+ Object target = JavaModel.getTarget(ResourcesPlugin.getWorkspace().getRoot(), new Path(path).makeAbsolute(), true); >+ long libraryJDK = org.eclipse.jdt.internal.core.util.Util.getJdkLevel(target); >+ String jclRuntime = CompilerOptions.versionFromJdkLevel(libraryJDK); >+ StringBuffer jdkLevelProblem = new StringBuffer("Problem : Incompatible .class files version in required binaries. Project 'Project' is targeting a "); >+ jdkLevelProblem.append(expectedRuntime); >+ jdkLevelProblem.append(" runtime, but is compiled against '"); >+ jdkLevelProblem.append(path); >+ jdkLevelProblem.append("' which requires a "); >+ jdkLevelProblem.append(jclRuntime); >+ jdkLevelProblem.append(" runtime [ resource : </Project> range : <-1,-1> category : <10> severity : <"); >+ jdkLevelProblem.append(severity); >+ jdkLevelProblem.append(">]"); >+ return jdkLevelProblem.toString(); >+} > >- fullBuild(); >- expectingNoProblems(); >+public void testClasspathFileChange() throws JavaModelException { >+ // create project with src folder, and alternate unused src2 folder >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ IPath classTest1 = env.addClass(root, "p1", "Test1", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class Test1 extends Zork1 {}" //$NON-NLS-1$ >+ ); >+ // not yet on the classpath >+ IPath src2Path = env.addFolder(projectPath, "src2"); //$NON-NLS-1$ >+ IPath src2p1Path = env.addFolder(src2Path, "p1"); //$NON-NLS-1$ >+ env.addFile(src2p1Path, "Zork1.java", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class Zork1 {}" //$NON-NLS-1$ >+ ); > >- //---------------------------- >- // Step 2 >- //---------------------------- >- env.closeProject(project1Path); >+ fullBuild(); >+ expectingSpecificProblemFor(classTest1, new Problem("src", "Zork1 cannot be resolved to a type", classTest1,39, 44, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ > >- incrementalBuild(); >- expectingOnlyProblemsFor(new IPath[] {project2Path, project3Path}); >- expectingOnlySpecificProblemsFor(project2Path, >- new Problem[] { >- new Problem("", "The project cannot be built until build path errors are resolved", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ >- new Problem("Build path", "Project 'CP2' is missing required Java project: 'CP1'", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- } >- ); >- expectingOnlySpecificProblemsFor(project3Path, >- new Problem[] { >- new Problem("", "The project cannot be built until build path errors are resolved", project3Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ >- new Problem("Build path", "Project 'CP3' is missing required library: '/CP1/temp.jar'", project3Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- } >- ); >+ //---------------------------- >+ // Step 2 >+ //---------------------------- >+ StringBuffer buffer = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); //$NON-NLS-1$ >+ buffer.append("<classpath>\n"); //$NON-NLS-1$ >+ buffer.append(" <classpathentry kind=\"src\" path=\"src\"/>\n"); //$NON-NLS-1$ >+ buffer.append(" <classpathentry kind=\"src\" path=\"src2\"/>\n"); // add src2 on classpath through resource change //$NON-NLS-1$ >+ String[] classlibs = Util.getJavaClassLibs(); >+ for (int i = 0; i < classlibs.length; i++) { >+ buffer.append(" <classpathentry kind=\"lib\" path=\"").append(classlibs[i]).append("\"/>\n"); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ buffer.append(" <classpathentry kind=\"output\" path=\"bin\"/>\n"); //$NON-NLS-1$ >+ buffer.append("</classpath>"); //$NON-NLS-1$ >+ boolean wasAutoBuilding = env.isAutoBuilding(); >+ try { >+ // turn autobuild on >+ env.setAutoBuilding(true); >+ // write new .classpath, will trigger autobuild >+ env.addFile(projectPath, ".classpath", buffer.toString()); //$NON-NLS-1$ >+ // ensures the builder did see the classpath change >+ env.waitForAutoBuild(); >+ expectingNoProblems(); >+ } finally { >+ env.setAutoBuilding(wasAutoBuilding); >+ } >+} >+ >+public void testClosedProject() throws JavaModelException { >+ IPath project1Path = env.addProject("CP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ IPath jarPath = env.addInternalJar(project1Path, "temp.jar", new byte[] {0}); //$NON-NLS-1$ >+ >+ IPath project2Path = env.addProject("CP2"); //$NON-NLS-1$ >+ env.addExternalJars(project2Path, Util.getJavaClassLibs()); >+ env.addRequiredProject(project2Path, project1Path); >+ >+ IPath project3Path = env.addProject("CP3"); //$NON-NLS-1$ >+ env.addExternalJars(project3Path, Util.getJavaClassLibs()); >+ env.addExternalJar(project3Path, jarPath.toString()); > >- env.openProject(project1Path); >- incrementalBuild(); >- expectingNoProblems(); >+ fullBuild(); >+ expectingNoProblems(); > >- //---------------------------- >- // Step 3 >- //---------------------------- >- Hashtable options = JavaCore.getOptions(); >- options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.IGNORE); >- JavaCore.setOptions(options); >- env.closeProject(project1Path); >+ //---------------------------- >+ // Step 2 >+ //---------------------------- >+ env.closeProject(project1Path); > >- incrementalBuild(); >- expectingOnlyProblemsFor(new IPath[] {project2Path, project3Path}); >- expectingOnlySpecificProblemFor(project2Path, >+ incrementalBuild(); >+ expectingOnlyProblemsFor(new IPath[] {project2Path, project3Path}); >+ expectingOnlySpecificProblemsFor(project2Path, >+ new Problem[] { >+ new Problem("", "The project cannot be built until build path errors are resolved", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ > new Problem("Build path", "Project 'CP2' is missing required Java project: 'CP1'", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- ); >- expectingOnlySpecificProblemFor(project3Path, >+ } >+ ); >+ expectingOnlySpecificProblemsFor(project3Path, >+ new Problem[] { >+ new Problem("", "The project cannot be built until build path errors are resolved", project3Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ > new Problem("Build path", "Project 'CP3' is missing required library: '/CP1/temp.jar'", project3Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- ); >+ } >+ ); > >- env.openProject(project1Path); >- incrementalBuild(); >- expectingNoProblems(); >+ env.openProject(project1Path); >+ incrementalBuild(); >+ expectingNoProblems(); > >- options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); >- JavaCore.setOptions(options); >- } >+ //---------------------------- >+ // Step 3 >+ //---------------------------- >+ Hashtable options = JavaCore.getOptions(); >+ options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.IGNORE); >+ JavaCore.setOptions(options); >+ env.closeProject(project1Path); > >- public void testCorruptBuilder() throws JavaModelException { >- IPath project1Path = env.addProject("P1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >- >- env.addClass(project1Path, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p;" + //$NON-NLS-1$ >- "public class Test {}" //$NON-NLS-1$ >- ); >+ incrementalBuild(); >+ expectingOnlyProblemsFor(new IPath[] {project2Path, project3Path}); >+ expectingOnlySpecificProblemFor(project2Path, >+ new Problem("Build path", "Project 'CP2' is missing required Java project: 'CP1'", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >+ ); >+ expectingOnlySpecificProblemFor(project3Path, >+ new Problem("Build path", "Project 'CP3' is missing required library: '/CP1/temp.jar'", project3Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >+ ); > >- fullBuild(); >- expectingNoProblems(); >+ env.openProject(project1Path); >+ incrementalBuild(); >+ expectingNoProblems(); > >- IPath outputFolderPackage = env.getOutputLocation(project1Path).append("p"); //$NON-NLS-1$ >- env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ >+ options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); >+ JavaCore.setOptions(options); >+} > >- IPath subTest = env.addClass(project1Path, "", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >- "public class SubTest extends p.Test {}" //$NON-NLS-1$ >- ); >+public void testCorruptBuilder() throws JavaModelException { >+ IPath project1Path = env.addProject("P1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ >+ env.addClass(project1Path, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;" + //$NON-NLS-1$ >+ "public class Test {}" //$NON-NLS-1$ >+ ); > >- incrementalBuild(); >- expectingOnlySpecificProblemFor(subTest, new Problem("", "p.Test cannot be resolved to a type", subTest, 29, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$) >+ fullBuild(); >+ expectingNoProblems(); > >- env.addClass(project1Path, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p;" + //$NON-NLS-1$ >- "public class Test {}" //$NON-NLS-1$ >- ); >+ IPath outputFolderPackage = env.getOutputLocation(project1Path).append("p"); //$NON-NLS-1$ >+ env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ > >- fullBuild(); >- expectingNoProblems(); >+ IPath subTest = env.addClass(project1Path, "", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >+ "public class SubTest extends p.Test {}" //$NON-NLS-1$ >+ ); > >- Hashtable options = JavaCore.getOptions(); >- options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.ENABLED); >- JavaCore.setOptions(options); >+ incrementalBuild(); >+ expectingOnlySpecificProblemFor(subTest, new Problem("", "p.Test cannot be resolved to a type", subTest, 29, 35, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$) > >- env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ >+ env.addClass(project1Path, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;" + //$NON-NLS-1$ >+ "public class Test {}" //$NON-NLS-1$ >+ ); > >- incrementalBuild(); >- expectingNoProblems(); >+ fullBuild(); >+ expectingNoProblems(); > >- options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.IGNORE); >- JavaCore.setOptions(options); >- } >+ Hashtable options = JavaCore.getOptions(); >+ options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.ENABLED); >+ JavaCore.setOptions(options); > >- public void testCorruptBuilder2() throws JavaModelException { >- IPath project1Path = env.addProject("P1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >- env.removePackageFragmentRoot(project1Path, ""); //$NON-NLS-1$ >- IPath src = env.addPackageFragmentRoot(project1Path, "src"); //$NON-NLS-1$ >- IPath bin = env.setOutputFolder(project1Path, "bin"); //$NON-NLS-1$ >- >- env.addClass(src, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p;" + //$NON-NLS-1$ >- "public class Test {}" //$NON-NLS-1$ >- ); >+ env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ > >- fullBuild(); >- expectingNoProblems(); >+ incrementalBuild(); >+ expectingNoProblems(); > >- IPath outputFolderPackage = bin.append("p"); //$NON-NLS-1$ >- env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ >+ options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.IGNORE); >+ JavaCore.setOptions(options); >+} > >- IPath subTest = env.addClass(src, "p2", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p2;" + //$NON-NLS-1$ >- "public class SubTest extends p.Test {}" //$NON-NLS-1$ >- ); >+public void testCorruptBuilder2() throws JavaModelException { >+ IPath project1Path = env.addProject("P1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ env.removePackageFragmentRoot(project1Path, ""); //$NON-NLS-1$ >+ IPath src = env.addPackageFragmentRoot(project1Path, "src"); //$NON-NLS-1$ >+ IPath bin = env.setOutputFolder(project1Path, "bin"); //$NON-NLS-1$ >+ >+ env.addClass(src, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;" + //$NON-NLS-1$ >+ "public class Test {}" //$NON-NLS-1$ >+ ); > >- incrementalBuild(); >- expectingOnlySpecificProblemFor(subTest, new Problem("", "p.Test cannot be resolved to a type", subTest, 40, 46, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$) >+ fullBuild(); >+ expectingNoProblems(); > >- env.addClass(src, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p;" + //$NON-NLS-1$ >- "public class Test {}" //$NON-NLS-1$ >- ); >+ IPath outputFolderPackage = bin.append("p"); //$NON-NLS-1$ >+ env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ > >- fullBuild(); >- expectingNoProblems(); >+ IPath subTest = env.addClass(src, "p2", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;" + //$NON-NLS-1$ >+ "public class SubTest extends p.Test {}" //$NON-NLS-1$ >+ ); > >- Hashtable options = JavaCore.getOptions(); >- options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.ENABLED); >- JavaCore.setOptions(options); >+ incrementalBuild(); >+ expectingOnlySpecificProblemFor(subTest, new Problem("", "p.Test cannot be resolved to a type", subTest, 40, 46, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$) > >- env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ >+ env.addClass(src, "p", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;" + //$NON-NLS-1$ >+ "public class Test {}" //$NON-NLS-1$ >+ ); > >- incrementalBuild(); >- expectingNoProblems(); >+ fullBuild(); >+ expectingNoProblems(); > >- options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.IGNORE); >- JavaCore.setOptions(options); >- } >+ Hashtable options = JavaCore.getOptions(); >+ options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.ENABLED); >+ JavaCore.setOptions(options); > >- /* >- * Ensures that changing an external jar and refreshing the projects triggers a rebuild >- * (regression test for bug 50207 Compile errors fixed by 'refresh' do not reset problem list or package explorer error states) >- */ >- public void testExternalJarChange() throws JavaModelException, IOException { >- // setup >- IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >- env.addExternalJars(projectPath, Util.getJavaClassLibs()); >- IPath root = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$ >- IPath classTest = env.addClass(root, "p", "X", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p;\n"+ //$NON-NLS-1$ >- "public class X {\n" + //$NON-NLS-1$ >- " void foo() {\n" + //$NON-NLS-1$ >- " new q.Y().bar();\n" + //$NON-NLS-1$ >- " }\n" + //$NON-NLS-1$ >- "}" //$NON-NLS-1$ >- ); >- String externalJar = Util.getOutputDirectory() + File.separator + "test.jar"; //$NON-NLS-1$ >- Util.createJar( >- new String[] { >- "q/Y.java", //$NON-NLS-1$ >- "package q;\n" + //$NON-NLS-1$ >- "public class Y {\n" + //$NON-NLS-1$ >- "}" //$NON-NLS-1$ >- }, >- new HashMap(), >- externalJar >- ); >- long lastModified = new java.io.File(externalJar).lastModified(); >- env.addExternalJar(projectPath, externalJar); >- >- // build -> expecting problems >- fullBuild(); >- expectingProblemsFor(classTest); >- >- try { >- Thread.sleep(1000); >- } catch(InterruptedException e) { >- } >- // fix jar >- Util.createJar( >- new String[] { >- "q/Y.java", //$NON-NLS-1$ >- "package q;\n" + //$NON-NLS-1$ >- "public class Y {\n" + //$NON-NLS-1$ >- " public void bar() {\n" + //$NON-NLS-1$ >- " }\n" + //$NON-NLS-1$ >- "}" //$NON-NLS-1$ >- }, >- new HashMap(), >- externalJar >- ); >- >- new java.io.File(externalJar).setLastModified(lastModified + 1000); // to be sure its different >- // refresh project and rebuild -> expecting no problems >- IJavaProject project = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject("Project")); //$NON-NLS-1$ >- project.getJavaModel().refreshExternalArchives(new IJavaElement[] {project}, null); >- incrementalBuild(); >- expectingNoProblems(); >- >- } >+ env.removeBinaryClass(outputFolderPackage, "Test"); //$NON-NLS-1$ > >- public void testMissingBuilder() throws JavaModelException { >- IPath project1Path = env.addProject("P1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >- >- IPath project2Path = env.addProject("P2"); //$NON-NLS-1$ >- env.addExternalJars(project2Path, Util.getJavaClassLibs()); >- env.addRequiredProject(project2Path, project1Path); >+ incrementalBuild(); >+ expectingNoProblems(); > >- env.addClass(project1Path, "", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >- "public class Test {}" //$NON-NLS-1$ >- ); >+ options.put(JavaCore.CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER, JavaCore.IGNORE); >+ JavaCore.setOptions(options); >+} > >- IPath sub = env.addClass(project2Path, "", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >- "public class SubTest extends Test {}" //$NON-NLS-1$ >- ); >+/* >+ * Ensures that changing an external jar and refreshing the projects triggers a rebuild >+ * (regression test for bug 50207 Compile errors fixed by 'refresh' do not reset problem list or package explorer error states) >+ */ >+public void testExternalJarChange() throws JavaModelException, IOException { >+ // setup >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ IPath root = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$ >+ IPath classTest = env.addClass(root, "p", "X", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p;\n"+ //$NON-NLS-1$ >+ "public class X {\n" + //$NON-NLS-1$ >+ " void foo() {\n" + //$NON-NLS-1$ >+ " new q.Y().bar();\n" + //$NON-NLS-1$ >+ " }\n" + //$NON-NLS-1$ >+ "}" //$NON-NLS-1$ >+ ); >+ String externalJar = Util.getOutputDirectory() + File.separator + "test.jar"; //$NON-NLS-1$ >+ Util.createJar( >+ new String[] { >+ "q/Y.java", //$NON-NLS-1$ >+ "package q;\n" + //$NON-NLS-1$ >+ "public class Y {\n" + //$NON-NLS-1$ >+ "}" //$NON-NLS-1$ >+ }, >+ new HashMap(), >+ externalJar >+ ); >+ long lastModified = new java.io.File(externalJar).lastModified(); >+ env.addExternalJar(projectPath, externalJar); >+ >+ // build -> expecting problems >+ fullBuild(); >+ expectingProblemsFor( >+ classTest, >+ "Problem : The method bar() is undefined for the type Y [ resource : </Project/p/X.java> range : <57,60> category : <50> severity : <2>]" >+ ); >+ >+ try { >+ Thread.sleep(1000); >+ } catch(InterruptedException e) { >+ } >+ // fix jar >+ Util.createJar( >+ new String[] { >+ "q/Y.java", //$NON-NLS-1$ >+ "package q;\n" + //$NON-NLS-1$ >+ "public class Y {\n" + //$NON-NLS-1$ >+ " public void bar() {\n" + //$NON-NLS-1$ >+ " }\n" + //$NON-NLS-1$ >+ "}" //$NON-NLS-1$ >+ }, >+ new HashMap(), >+ externalJar >+ ); >+ >+ new java.io.File(externalJar).setLastModified(lastModified + 1000); // to be sure its different >+ // refresh project and rebuild -> expecting no problems >+ IJavaProject project = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().getProject("Project")); //$NON-NLS-1$ >+ project.getJavaModel().refreshExternalArchives(new IJavaElement[] {project}, null); >+ incrementalBuild(); >+ expectingNoProblems(); >+ >+} > >- fullBuild(); >- expectingNoProblems(); >+public void testMissingBuilder() throws JavaModelException { >+ IPath project1Path = env.addProject("P1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ >+ IPath project2Path = env.addProject("P2"); //$NON-NLS-1$ >+ env.addExternalJars(project2Path, Util.getJavaClassLibs()); >+ env.addRequiredProject(project2Path, project1Path); > >- env.removeRequiredProject(project2Path, project1Path); >+ env.addClass(project1Path, "", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "public class Test {}" //$NON-NLS-1$ >+ ); > >- incrementalBuild(); >- expectingOnlySpecificProblemFor(sub, new Problem("", "Test cannot be resolved to a type", sub, 29, 33, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$) >+ IPath sub = env.addClass(project2Path, "", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >+ "public class SubTest extends Test {}" //$NON-NLS-1$ >+ ); > >- env.addRequiredProject(project2Path, project1Path); >+ fullBuild(); >+ expectingNoProblems(); > >- try { >- JavaProject p = (JavaProject) env.getJavaProject(project1Path); >- p.deconfigure(); >- JavaModelManager.getJavaModelManager().setLastBuiltState(p.getProject(), null); >- } catch (CoreException e) { >- e.printStackTrace(); >- } >+ env.removeRequiredProject(project2Path, project1Path); > >- env.addClass(project2Path, "", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >- "public class SubTest extends Test {}" //$NON-NLS-1$ >- ); >+ incrementalBuild(); >+ expectingOnlySpecificProblemFor(sub, new Problem("", "Test cannot be resolved to a type", sub, 29, 33, CategorizedProblem.CAT_TYPE, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$) > >- incrementalBuild(); >- expectingNoProblems(); >- } >+ env.addRequiredProject(project2Path, project1Path); > >- public void testMissingFieldType() throws JavaModelException { >- IPath projectPath = env.addProject("Project1"); //$NON-NLS-1$ >- env.addExternalJars(projectPath, Util.getJavaClassLibs()); >- IPath root = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$ >- env.addClass(root, "p1", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p1;\n"+ //$NON-NLS-1$ >- "public class Test {}" //$NON-NLS-1$ >- ); >+ try { >+ JavaProject p = (JavaProject) env.getJavaProject(project1Path); >+ p.deconfigure(); >+ JavaModelManager.getJavaModelManager().setLastBuiltState(p.getProject(), null); >+ } catch (CoreException e) { >+ e.printStackTrace(); >+ } > >- fullBuild(); >- expectingNoProblems(); >+ env.addClass(project2Path, "", "SubTest", //$NON-NLS-1$ //$NON-NLS-2$ >+ "public class SubTest extends Test {}" //$NON-NLS-1$ >+ ); > >- IPath projectPath2 = env.addProject("Project2"); //$NON-NLS-1$ >- env.addExternalJars(projectPath2, Util.getJavaClassLibs()); >- env.addRequiredProject(projectPath2, projectPath); >- IPath root2 = env.getPackageFragmentRootPath(projectPath2, ""); //$NON-NLS-1$ >- env.addClass(root2, "p2", "Test2", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p2;\n"+ //$NON-NLS-1$ >- "public class Test2 {\n" + //$NON-NLS-1$ >- " public static p1.Test field;\n" + //$NON-NLS-1$ >- "}" //$NON-NLS-1$ >- ); >+ incrementalBuild(); >+ expectingNoProblems(); >+} > >- incrementalBuild(); >- expectingNoProblems(); >+public void testMissingFieldType() throws JavaModelException { >+ IPath projectPath = env.addProject("Project1"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ IPath root = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$ >+ env.addClass(root, "p1", "Test", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class Test {}" //$NON-NLS-1$ >+ ); > >- IPath projectPath3 = env.addProject("Project3"); //$NON-NLS-1$ >- env.addExternalJars(projectPath3, Util.getJavaClassLibs()); >- env.addRequiredProject(projectPath3, projectPath2); >- IPath root3 = env.getPackageFragmentRootPath(projectPath3, ""); //$NON-NLS-1$ >- env.addClass(root3, "p3", "Test3", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p3;\n"+ //$NON-NLS-1$ >- "public class Test3 extends p2.Test2 {\n" + //$NON-NLS-1$ >- " static Object field;\n" + //$NON-NLS-1$ >- "}" //$NON-NLS-1$ >- ); >+ fullBuild(); >+ expectingNoProblems(); > >- incrementalBuild(); >- expectingNoProblems(); >- } >+ IPath projectPath2 = env.addProject("Project2"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath2, Util.getJavaClassLibs()); >+ env.addRequiredProject(projectPath2, projectPath); >+ IPath root2 = env.getPackageFragmentRootPath(projectPath2, ""); //$NON-NLS-1$ >+ env.addClass(root2, "p2", "Test2", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Test2 {\n" + //$NON-NLS-1$ >+ " public static p1.Test field;\n" + //$NON-NLS-1$ >+ "}" //$NON-NLS-1$ >+ ); > >- public void testMissingLibrary1() throws JavaModelException { >- IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >- env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >- IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >- IPath bin = env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >- IPath classTest1 = env.addClass(root, "p1", "Test1", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p1;\n"+ //$NON-NLS-1$ >- "public class Test1 {}" //$NON-NLS-1$ >- ); >+ incrementalBuild(); >+ expectingNoProblems(); > >- fullBuild(); >- expectingOnlyProblemsFor(new IPath[] {projectPath, classTest1}); >- expectingOnlySpecificProblemsFor(projectPath, >- new Problem[] { >- new Problem("", "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ >- new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, 0, 1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- } >- ); >+ IPath projectPath3 = env.addProject("Project3"); //$NON-NLS-1$ >+ env.addExternalJars(projectPath3, Util.getJavaClassLibs()); >+ env.addRequiredProject(projectPath3, projectPath2); >+ IPath root3 = env.getPackageFragmentRootPath(projectPath3, ""); //$NON-NLS-1$ >+ env.addClass(root3, "p3", "Test3", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p3;\n"+ //$NON-NLS-1$ >+ "public class Test3 extends p2.Test2 {\n" + //$NON-NLS-1$ >+ " static Object field;\n" + //$NON-NLS-1$ >+ "}" //$NON-NLS-1$ >+ ); > >- //---------------------------- >- // Step 2 >- //---------------------------- >- env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ incrementalBuild(); >+ expectingNoProblems(); >+} > >- incrementalBuild(); >- expectingNoProblems(); >- expectingPresenceOf(new IPath[]{ >- bin.append("p1").append("Test1.class"), //$NON-NLS-1$ //$NON-NLS-2$ >- }); >- } >- >- public void testMissingLibrary2() throws JavaModelException { >- IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >- env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >- IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >- IPath bin = env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >- IPath classTest1 = env.addClass(root, "p1", "Test1", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p1;\n"+ //$NON-NLS-1$ >- "public class Test1 {}" //$NON-NLS-1$ >- ); >- IPath classTest2 = env.addClass(root, "p2", "Test2", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p2;\n"+ //$NON-NLS-1$ >- "public class Test2 {}" //$NON-NLS-1$ >- ); >- IPath classTest3 = env.addClass(root, "p2", "Test3", //$NON-NLS-1$ //$NON-NLS-2$ >- "package p2;\n"+ //$NON-NLS-1$ >- "public class Test3 {}" //$NON-NLS-1$ >- ); >+public void testMissingLibrary1() throws JavaModelException { >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ IPath bin = env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ IPath classTest1 = env.addClass(root, "p1", "Test1", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class Test1 {}" //$NON-NLS-1$ >+ ); > >- fullBuild(); >- expectingSpecificProblemFor( >- projectPath, >- new Problem("", "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >- >- Problem[] prob1 = env.getProblemsFor(classTest1); >- Problem[] prob2 = env.getProblemsFor(classTest2); >- Problem[] prob3 = env.getProblemsFor(classTest3); >- assertEquals("too many problems", prob1.length + prob2.length + prob3.length, 1); //$NON-NLS-1$ >- if(prob1.length == 1) { >- expectingSpecificProblemFor(classTest1, new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >- } else if (prob2.length == 1) { >- expectingSpecificProblemFor(classTest2, new Problem("p2", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest2, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >- } else { >- expectingSpecificProblemFor(classTest3, new Problem("p2", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest3, 0, 1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ fullBuild(); >+ expectingOnlyProblemsFor(new IPath[] {projectPath, classTest1}); >+ expectingOnlySpecificProblemsFor(projectPath, >+ new Problem[] { >+ new Problem("", "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ >+ new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, 0, 1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ > } >+ ); > >- //---------------------------- >- // Step 2 >- //---------------------------- >- env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ //---------------------------- >+ // Step 2 >+ //---------------------------- >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); > >- incrementalBuild(); >- expectingNoProblems(); >- expectingPresenceOf(new IPath[]{ >- bin.append("p1").append("Test1.class"), //$NON-NLS-1$ //$NON-NLS-2$ >- bin.append("p2").append("Test2.class"), //$NON-NLS-1$ //$NON-NLS-2$ >- bin.append("p2").append("Test3.class") //$NON-NLS-1$ //$NON-NLS-2$ >- }); >+ incrementalBuild(); >+ expectingNoProblems(); >+ expectingPresenceOf(new IPath[]{ >+ bin.append("p1").append("Test1.class"), //$NON-NLS-1$ //$NON-NLS-2$ >+ }); >+ env.removeProject(projectPath); >+} >+ >+public void testMissingLibrary2() throws JavaModelException { >+ IPath projectPath = env.addProject("Project"); //$NON-NLS-1$ >+ env.removePackageFragmentRoot(projectPath, ""); //$NON-NLS-1$ >+ IPath root = env.addPackageFragmentRoot(projectPath, "src"); //$NON-NLS-1$ >+ IPath bin = env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$ >+ IPath classTest1 = env.addClass(root, "p1", "Test1", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p1;\n"+ //$NON-NLS-1$ >+ "public class Test1 {}" //$NON-NLS-1$ >+ ); >+ IPath classTest2 = env.addClass(root, "p2", "Test2", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Test2 {}" //$NON-NLS-1$ >+ ); >+ IPath classTest3 = env.addClass(root, "p2", "Test3", //$NON-NLS-1$ //$NON-NLS-2$ >+ "package p2;\n"+ //$NON-NLS-1$ >+ "public class Test3 {}" //$NON-NLS-1$ >+ ); >+ >+ fullBuild(); >+ expectingSpecificProblemFor( >+ projectPath, >+ new Problem("", "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ Problem[] prob1 = env.getProblemsFor(classTest1); >+ Problem[] prob2 = env.getProblemsFor(classTest2); >+ Problem[] prob3 = env.getProblemsFor(classTest3); >+ assertEquals("too many problems", prob1.length + prob2.length + prob3.length, 1); //$NON-NLS-1$ >+ if(prob1.length == 1) { >+ expectingSpecificProblemFor(classTest1, new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ } else if (prob2.length == 1) { >+ expectingSpecificProblemFor(classTest2, new Problem("p2", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest2, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ >+ } else { >+ expectingSpecificProblemFor(classTest3, new Problem("p2", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest3, 0, 1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$ > } > >+ //---------------------------- >+ // Step 2 >+ //---------------------------- >+ env.addExternalJars(projectPath, Util.getJavaClassLibs()); >+ >+ incrementalBuild(); >+ expectingNoProblems(); >+ expectingPresenceOf(new IPath[]{ >+ bin.append("p1").append("Test1.class"), //$NON-NLS-1$ //$NON-NLS-2$ >+ bin.append("p2").append("Test2.class"), //$NON-NLS-1$ //$NON-NLS-2$ >+ bin.append("p2").append("Test3.class") //$NON-NLS-1$ //$NON-NLS-2$ >+ }); >+ env.removeProject(projectPath); >+} >+ > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345 > public void testMissingLibrary3() throws JavaModelException { > this.abortOnFailure = false; // this test is failing on some releng boxes => do not abort on failures >@@ -491,6 +514,7 @@ > expectingSpecificProblemFor( > projectPath, > new Problem("Build path", "Project 'Project' is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)); >+ env.removeProject(projectPath); > } > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345 >@@ -509,113 +533,205 @@ > projectPath, > new Problem("Build path", "Project 'Project' is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR)); > project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING); >- cleanBuild(); >+ incrementalBuild(); > expectingSpecificProblemFor( > projectPath, > new Problem("Build path", "Project 'Project' is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, > IMarker.SEVERITY_WARNING)); >+ env.removeProject(projectPath); > } >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345 >+public void testIncompatibleJdkLEvelOnProject() throws JavaModelException { >+ this.abortOnFailure = false; // NOT sure this test will pass on releng boxes => do not abort on failures > >- public void testMissingProject() throws JavaModelException { >- IPath project1Path = env.addProject("MP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >- >- IPath project2Path = env.addProject("MP2"); //$NON-NLS-1$ >- env.addExternalJars(project2Path, Util.getJavaClassLibs()); >- env.addRequiredProject(project2Path, project1Path); >+ // Create project >+ IPath projectPath = env.addProject("Project"); >+ IJavaProject project = env.getJavaProject(projectPath); >+ String[] classlibs = Util.getJavaClassLibs(); >+ env.addExternalJars(projectPath, classlibs); >+ >+ // Build it expecting no problem >+ fullBuild(); >+ expectingNoProblems(); >+ >+ // Build incompatible jdk level problem string >+ String jclPath = project.getPackageFragmentRoot(classlibs[0]).getPath().makeRelative().toString(); >+ String projectRuntime = project.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true); >+ >+ // Change project incompatible jdk level preferences to warning, perform incremental build and expect 1 problem >+ project.setOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, CompilerOptions.WARNING); >+ incrementalBuild(); >+ expectingProblemsFor( >+ projectPath, >+ getJdkLevelProblem(projectRuntime, jclPath, IMarker.SEVERITY_WARNING) >+ ); > >+ // Change project incompatible jdk level preferences to error, perform incremental build and expect 2 problems >+ project.setOption(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, CompilerOptions.ERROR); >+ incrementalBuild(); >+ expectingProblemsFor( >+ projectPath, >+ "Problem : The project cannot be built until build path errors are resolved [ resource : </Project> range : <-1,-1> category : <10> severity : <2>]\n" + >+ getJdkLevelProblem(projectRuntime, jclPath, IMarker.SEVERITY_ERROR) >+ ); >+ >+ // Remove project to avoid side effect on other tests >+ env.removeProject(projectPath); >+} >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345 >+public void testIncompatibleJdkLEvelOnWksp() throws JavaModelException { >+ >+ // Save preference >+ JavaModelManager manager = JavaModelManager.getJavaModelManager(); >+ IEclipsePreferences preferences = manager.getInstancePreferences(); >+ String incompatibleJdkLevel = preferences.get(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, null); >+ try { >+ this.abortOnFailure = false; // NOT sure this test will pass on all releng boxes => do not abort on failures >+ >+ // Create project >+ IPath projectPath = env.addProject("Project"); >+ IJavaProject project = env.getJavaProject(projectPath); >+ String[] classlibs = Util.getJavaClassLibs(); >+ env.addExternalJars(projectPath, classlibs); >+ >+ // Build it expecting no problem > fullBuild(); > expectingNoProblems(); > >- //---------------------------- >- // Step 2 >- //---------------------------- >- env.removeProject(project1Path); >- >+ // Build incompatible jdk level problem string >+ String jclPath = project.getPackageFragmentRoot(classlibs[0]).getPath().makeRelative().toString(); >+ String wkspRuntime = JavaCore.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM); >+ >+ // Change workspace incompatible jdk level preferences to warning, perform incremental build and expect 1 problem >+ preferences.put(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaCore.WARNING); > incrementalBuild(); >- expectingOnlyProblemsFor(project2Path); >- expectingOnlySpecificProblemsFor(project2Path, >- new Problem[] { >- new Problem("", "The project cannot be built until build path errors are resolved", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ >- new Problem("Build path", "Project 'MP2' is missing required Java project: 'MP1'", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- } >+ expectingProblemsFor( >+ projectPath, >+ getJdkLevelProblem(wkspRuntime, jclPath, IMarker.SEVERITY_WARNING) >+ ); >+ >+ // Change workspace incompatible jdk level preferences to error, perform incremental build and expect 2 problems >+ preferences.put(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, JavaCore.ERROR); >+ incrementalBuild(); >+ expectingProblemsFor( >+ projectPath, >+ "Problem : The project cannot be built until build path errors are resolved [ resource : </Project> range : <-1,-1> category : <10> severity : <2>]\n" + >+ getJdkLevelProblem(wkspRuntime, jclPath, IMarker.SEVERITY_ERROR) > ); >+ >+ // Remove project to avoid side effect on other tests >+ env.removeProject(projectPath); >+ } finally { >+ // Put back workspace preferences same as before running the test >+ if (incompatibleJdkLevel == null) { >+ preferences.remove(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL); >+ } else { >+ preferences.put(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, incompatibleJdkLevel); >+ } >+ } >+} > >- project1Path = env.addProject("MP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+public void testMissingProject() throws JavaModelException { >+ IPath project1Path = env.addProject("MP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ >+ IPath project2Path = env.addProject("MP2"); //$NON-NLS-1$ >+ env.addExternalJars(project2Path, Util.getJavaClassLibs()); >+ env.addRequiredProject(project2Path, project1Path); > >- incrementalBuild(); >- expectingNoProblems(); >+ fullBuild(); >+ expectingNoProblems(); > >- //---------------------------- >- // Step 3 >- //---------------------------- >- Hashtable options = JavaCore.getOptions(); >- options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.IGNORE); >- JavaCore.setOptions(options); >- env.removeProject(project1Path); >+ //---------------------------- >+ // Step 2 >+ //---------------------------- >+ env.removeProject(project1Path); > >- incrementalBuild(); >- expectingOnlyProblemsFor(project2Path); >- expectingOnlySpecificProblemFor(project2Path, >+ incrementalBuild(); >+ expectingOnlyProblemsFor(project2Path); >+ expectingOnlySpecificProblemsFor(project2Path, >+ new Problem[] { >+ new Problem("", "The project cannot be built until build path errors are resolved", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR), //$NON-NLS-1$ //$NON-NLS-2$ > new Problem("Build path", "Project 'MP2' is missing required Java project: 'MP1'", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >- ); >+ } >+ ); > >- project1Path = env.addProject("MP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ project1Path = env.addProject("MP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); > >- incrementalBuild(); >- expectingNoProblems(); >+ incrementalBuild(); >+ expectingNoProblems(); > >- options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); >- JavaCore.setOptions(options); >- } >- >- public void testMissingOptionalProject() throws JavaModelException { >- IPath project1Path = env.addProject("MP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >- >- IPath project2Path = env.addProject("MP2"); //$NON-NLS-1$ >- env.addExternalJars(project2Path, Util.getJavaClassLibs()); >- env.addRequiredProject(project2Path, project1Path, true/*optional*/); >+ //---------------------------- >+ // Step 3 >+ //---------------------------- >+ Hashtable options = JavaCore.getOptions(); >+ options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.IGNORE); >+ JavaCore.setOptions(options); >+ env.removeProject(project1Path); > >- fullBuild(); >- expectingNoProblems(); >+ incrementalBuild(); >+ expectingOnlyProblemsFor(project2Path); >+ expectingOnlySpecificProblemFor(project2Path, >+ new Problem("Build path", "Project 'MP2' is missing required Java project: 'MP1'", project2Path, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR) //$NON-NLS-1$ //$NON-NLS-2$ >+ ); > >- //---------------------------- >- // Step 2 >- //---------------------------- >- env.removeProject(project1Path); >+ project1Path = env.addProject("MP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); > >- incrementalBuild(); >- expectingNoProblems(); >+ incrementalBuild(); >+ expectingNoProblems(); > >- project1Path = env.addProject("MP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); >+ JavaCore.setOptions(options); >+} > >- incrementalBuild(); >- expectingNoProblems(); >+public void testMissingOptionalProject() throws JavaModelException { >+ IPath project1Path = env.addProject("MP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ >+ IPath project2Path = env.addProject("MP2"); //$NON-NLS-1$ >+ env.addExternalJars(project2Path, Util.getJavaClassLibs()); >+ env.addRequiredProject(project2Path, project1Path, true/*optional*/); > >- //---------------------------- >- // Step 3 >- //---------------------------- >- Hashtable options = JavaCore.getOptions(); >- options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.IGNORE); >- JavaCore.setOptions(options); >- env.removeProject(project1Path); >+ fullBuild(); >+ expectingNoProblems(); > >- incrementalBuild(); >- expectingNoProblems(); >+ //---------------------------- >+ // Step 2 >+ //---------------------------- >+ env.removeProject(project1Path); > >- project1Path = env.addProject("MP1"); //$NON-NLS-1$ >- env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ incrementalBuild(); >+ expectingNoProblems(); > >- incrementalBuild(); >- expectingNoProblems(); >+ project1Path = env.addProject("MP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); > >- options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); >- JavaCore.setOptions(options); >- } >+ incrementalBuild(); >+ expectingNoProblems(); >+ >+ //---------------------------- >+ // Step 3 >+ //---------------------------- >+ Hashtable options = JavaCore.getOptions(); >+ options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.IGNORE); >+ JavaCore.setOptions(options); >+ env.removeProject(project1Path); >+ >+ incrementalBuild(); >+ expectingNoProblems(); >+ >+ project1Path = env.addProject("MP1"); //$NON-NLS-1$ >+ env.addExternalJars(project1Path, Util.getJavaClassLibs()); >+ >+ incrementalBuild(); >+ expectingNoProblems(); >+ >+ options.put(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, JavaCore.ABORT); >+ JavaCore.setOptions(options); >+} > > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=160132 > public void test0100() throws JavaModelException { >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java,v >retrieving revision 1.39 >diff -u -r1.39 JavadocTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java 20 Dec 2006 16:11:25 -0000 1.39 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest.java 27 Feb 2007 11:52:04 -0000 >@@ -28,7 +28,6 @@ > static final String LINE_SEPARATOR = System.getProperty("line.separator"); > public static ArrayList ALL_CLASSES = null; > static final String DOC_COMMENT_SUPPORT = System.getProperty("doc.support"); >- static boolean debug = false; > > // Javadoc execution > protected static final String JAVADOC_NAME = >Index: src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java,v >retrieving revision 1.26 >diff -u -r1.26 TestCase.java >--- src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java 21 Feb 2007 09:51:39 -0000 1.26 >+++ src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java 27 Feb 2007 11:52:04 -0000 >@@ -17,7 +17,9 @@ > import java.util.*; > > import org.eclipse.jdt.core.Flags; >+import org.eclipse.jdt.core.tests.util.Util; > import org.eclipse.jdt.internal.compiler.batch.Main; >+import org.eclipse.test.performance.Performance; > import org.eclipse.test.performance.PerformanceTestCase; > > import junit.framework.AssertionFailedError; >@@ -239,11 +241,21 @@ > * Otherwise, the thrown exception {@link AssertionFailedError} is catched > * and its message is only displayed in the console hence producing no JUnit failure. > */ >-protected void assumeEquals(String msg, Object expected, Object actual) { >+protected void assumeEquals(String msg, String expected, String actual) { > try { >- assertEquals(msg, expected, actual); >+ assertStringEquals(msg, expected, actual, false); >+ } catch (ComparisonFailure cf) { >+ System.out.println("Failure while running test "+Performance.getDefault().getDefaultScenarioId(this)+"!!!"); >+ System.out.println("Actual output is:"); >+ System.out.println(Util.displayString(cf.getActual(), 2)); >+ System.out.println(); >+ if (abortOnFailure) { >+ throw cf; >+ } > } catch (AssertionFailedError afe) { >- if (abortOnFailure) throw afe; >+ if (abortOnFailure) { >+ throw afe; >+ } > printAssertionFailure(afe); > } > } >@@ -257,15 +269,26 @@ > protected void assumeTrue(String msg, boolean cond) { > try { > assertTrue(msg, cond); >+ } catch (ComparisonFailure cf) { >+ if (abortOnFailure) { >+ System.out.println("Failure while running test "+Performance.getDefault().getDefaultScenarioId(this)+"!!!"); >+ System.out.println("Actual output is:"); >+ System.out.println(Util.displayString(cf.getActual(), 2)); >+ System.out.println(); >+ throw cf; >+ } >+ printAssertionFailure(cf); > } catch (AssertionFailedError afe) { >- if (abortOnFailure) throw afe; >+ if (abortOnFailure) { >+ throw afe; >+ } > printAssertionFailure(afe); > } > } > > private void printAssertionFailure(AssertionFailedError afe) { > System.out.println("\n!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!!---!"); >- System.out.println("Catched assertion while running test "+getName()+":"); >+ System.out.println("Catched assertion failure while running test "+getName()+":"); > System.out.println(" "+afe.getMessage()); > System.out.println("--------------------------------------------------------------------------------\n"); > } >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaProject.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v >retrieving revision 1.381 >diff -u -r1.381 JavaProject.java >--- model/org/eclipse/jdt/internal/core/JavaProject.java 19 Feb 2007 17:23:55 -0000 1.381 >+++ model/org/eclipse/jdt/internal/core/JavaProject.java 27 Feb 2007 11:52:08 -0000 >@@ -18,6 +18,8 @@ > import java.util.Hashtable; > import java.util.Iterator; > import java.util.Map; >+import java.util.StringTokenizer; >+ > import javax.xml.parsers.DocumentBuilder; > import javax.xml.parsers.DocumentBuilderFactory; > import javax.xml.parsers.ParserConfigurationException; >@@ -1386,44 +1388,58 @@ > return null; > } > >- /** >- * Returns the project custom preference pool. >- * Project preferences may include custom encoding. >- * @return IEclipsePreferences >- */ >- public IEclipsePreferences getEclipsePreferences(){ >- if (!JavaProject.hasJavaNature(this.project)) return null; >- // Get cached preferences if exist >- JavaModelManager.PerProjectInfo perProjectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfo(this.project, true); >- if (perProjectInfo.preferences != null) return perProjectInfo.preferences; >- // Init project preferences >- IScopeContext context = new ProjectScope(getProject()); >- final IEclipsePreferences eclipsePreferences = context.getNode(JavaCore.PLUGIN_ID); >- updatePreferences(eclipsePreferences); >- perProjectInfo.preferences = eclipsePreferences; >- >- // Listen to node removal from parent in order to reset cache (see bug 68993) >- IEclipsePreferences.INodeChangeListener nodeListener = new IEclipsePreferences.INodeChangeListener() { >- public void added(IEclipsePreferences.NodeChangeEvent event) { >- // do nothing >- } >- public void removed(IEclipsePreferences.NodeChangeEvent event) { >- if (event.getChild() == eclipsePreferences) { >- JavaModelManager.getJavaModelManager().resetProjectPreferences(JavaProject.this); >- } >- } >- }; >- ((IEclipsePreferences) eclipsePreferences.parent()).addNodeChangeListener(nodeListener); >- >- // Listen to preference changes >- IEclipsePreferences.IPreferenceChangeListener preferenceListener = new IEclipsePreferences.IPreferenceChangeListener() { >- public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) { >- JavaModelManager.getJavaModelManager().resetProjectOptions(JavaProject.this); >- } >- }; >- eclipsePreferences.addPreferenceChangeListener(preferenceListener); >- return eclipsePreferences; >- } >+ /** >+ * Returns the project custom preference pool. >+ * Project preferences may include custom encoding. >+ * @return IEclipsePreferences >+ */ >+ public IEclipsePreferences getEclipsePreferences(){ >+ if (!JavaProject.hasJavaNature(this.project)) return null; >+ // Get cached preferences if exist >+ JavaModelManager.PerProjectInfo perProjectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfo(this.project, true); >+ if (perProjectInfo.preferences != null) return perProjectInfo.preferences; >+ // Init project preferences >+ IScopeContext context = new ProjectScope(getProject()); >+ final IEclipsePreferences eclipsePreferences = context.getNode(JavaCore.PLUGIN_ID); >+ updatePreferences(eclipsePreferences); >+ perProjectInfo.preferences = eclipsePreferences; >+ >+ // Listen to node removal from parent in order to reset cache (see bug 68993) >+ IEclipsePreferences.INodeChangeListener nodeListener = new IEclipsePreferences.INodeChangeListener() { >+ public void added(IEclipsePreferences.NodeChangeEvent event) { >+ // do nothing >+ } >+ public void removed(IEclipsePreferences.NodeChangeEvent event) { >+ if (event.getChild() == eclipsePreferences) { >+ JavaModelManager.getJavaModelManager().resetProjectPreferences(JavaProject.this); >+ } >+ } >+ }; >+ ((IEclipsePreferences) eclipsePreferences.parent()).addNodeChangeListener(nodeListener); >+ >+ // Listen to preference changes >+ IEclipsePreferences.IPreferenceChangeListener preferenceListener = new IEclipsePreferences.IPreferenceChangeListener() { >+ public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) { >+ JavaModelManager manager = JavaModelManager.getJavaModelManager(); >+ int length = JavaCore.PLUGIN_ID.length() + 1; >+ String key = event.getKey(); >+ StringTokenizer tokenizer = new StringTokenizer(key.substring(length)); >+ String token = tokenizer.nextToken(); >+ if (key.equals(JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER) || >+ token.equals("builder") || //$NON-NLS-1$ >+ key.equals(JavaCore.CORE_INCOMPLETE_CLASSPATH) || >+ key.equals(JavaCore.CORE_CIRCULAR_CLASSPATH) || >+ key.equals(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL) || >+ token.equals("classpath")) //$NON-NLS-1$ >+ { >+ manager.deltaState.addClasspathValidation(JavaProject.this); >+ } >+ manager.resetProjectOptions(JavaProject.this); >+ } >+ }; >+ eclipsePreferences.addPreferenceChangeListener(preferenceListener); >+ return eclipsePreferences; >+ } > > public String getElementName() { > return this.project.getName(); >@@ -2159,12 +2175,8 @@ > > /** > * load preferences from a shareable format (VCM-wise) >- * @deprecated WARNING, visibility of this method will be decreased soon >- * to private and won't be usable in the future. >- * @see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=59258">bug 59258</a> >- * TODO (frederic) set visibility from public to private > */ >- public Preferences loadPreferences() { >+ private Preferences loadPreferences() { > > Preferences preferences = new Preferences(); > IPath projectMetaLocation = getPluginWorkingLocation(); >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.354 >diff -u -r1.354 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 19 Feb 2007 18:27:06 -0000 1.354 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 27 Feb 2007 11:52:07 -0000 >@@ -1126,44 +1126,75 @@ > /** > * Update the classpath variable cache > */ >- public static class EclipsePreferencesListener implements IEclipsePreferences.IPreferenceChangeListener { >+ public class EclipsePreferencesListener implements IEclipsePreferences.IPreferenceChangeListener { > /** >- * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) >- */ >- public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) { >- String propertyName = event.getKey(); >- if (propertyName.startsWith(CP_VARIABLE_PREFERENCES_PREFIX)) { >- String varName = propertyName.substring(CP_VARIABLE_PREFERENCES_PREFIX.length()); >- JavaModelManager manager = getJavaModelManager(); >- if (manager.variablesWithInitializer.contains(varName)) { >- // revert preference value as we will not apply it to JavaCore classpath variable >- String oldValue = (String) event.getOldValue(); >- if (oldValue == null) { >- // unexpected old value => remove variable from set >- manager.variablesWithInitializer.remove(varName); >- } else { >- manager.getInstancePreferences().put(varName, oldValue); >- } >- } else { >- String newValue = (String)event.getNewValue(); >- IPath newPath; >- if (newValue != null && !(newValue = newValue.trim()).equals(CP_ENTRY_IGNORE)) { >- newPath = new Path(newValue); >- } else { >- newPath = null; >- } >- try { >- SetVariablesOperation operation = new SetVariablesOperation(new String[] {varName}, new IPath[] {newPath}, false/*don't update preferences*/); >- operation.runOperation(null/*no progress available*/); >- } catch (JavaModelException e) { >- Util.log(e, "Could not set classpath variable " + varName + " to " + newPath); //$NON-NLS-1$ //$NON-NLS-2$ >- } >- } >- } >- if (propertyName.startsWith(CP_CONTAINER_PREFERENCES_PREFIX)) { >- recreatePersistedContainer(propertyName, (String)event.getNewValue(), false); >- } >- } >+ * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) >+ */ >+ public void preferenceChange(IEclipsePreferences.PreferenceChangeEvent event) { >+ String propertyName = event.getKey(); >+ if (propertyName.startsWith(CP_VARIABLE_PREFERENCES_PREFIX)) { >+ String varName = propertyName.substring(CP_VARIABLE_PREFERENCES_PREFIX.length()); >+ JavaModelManager manager = getJavaModelManager(); >+ if (manager.variablesWithInitializer.contains(varName)) { >+ // revert preference value as we will not apply it to JavaCore classpath variable >+ String oldValue = (String) event.getOldValue(); >+ if (oldValue == null) { >+ // unexpected old value => remove variable from set >+ manager.variablesWithInitializer.remove(varName); >+ } else { >+ manager.getInstancePreferences().put(varName, oldValue); >+ } >+ } else { >+ String newValue = (String)event.getNewValue(); >+ IPath newPath; >+ if (newValue != null && !(newValue = newValue.trim()).equals(CP_ENTRY_IGNORE)) { >+ newPath = new Path(newValue); >+ } else { >+ newPath = null; >+ } >+ try { >+ SetVariablesOperation operation = new SetVariablesOperation(new String[] {varName}, new IPath[] {newPath}, false/*don't update preferences*/); >+ operation.runOperation(null/*no progress available*/); >+ } catch (JavaModelException e) { >+ Util.log(e, "Could not set classpath variable " + varName + " to " + newPath); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ } >+ } >+ else if (propertyName.startsWith(CP_CONTAINER_PREFERENCES_PREFIX)) { >+ recreatePersistedContainer(propertyName, (String)event.getNewValue(), false); >+ } else { >+ int length = JavaCore.PLUGIN_ID.length() + 1; >+ String key = event.getKey(); >+ StringTokenizer tokenizer = new StringTokenizer(key.substring(length)); >+ String token = tokenizer.nextToken(); >+ if (key.equals(JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER) || >+ token.equals("builder") || //$NON-NLS-1$ >+ key.equals(JavaCore.CORE_INCOMPLETE_CLASSPATH) || >+ key.equals(JavaCore.CORE_CIRCULAR_CLASSPATH) || >+ key.equals(JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL) || >+ token.equals("classpath")) //$NON-NLS-1$ >+ { >+ JavaModelManager manager = JavaModelManager.getJavaModelManager(); >+ IJavaModel model = manager.getJavaModel(); >+ IJavaProject[] projects; >+ try { >+ projects = model.getJavaProjects(); >+ for (int i = 0, pl = projects.length; i < pl; i++) { >+ JavaProject javaProject = (JavaProject) projects[i]; >+ manager.deltaState.addClasspathValidation(javaProject); >+ try { >+ // need to touch the project to force validation by DeltaProcessor >+ javaProject.getProject().touch(null); >+ } catch (CoreException e) { >+ // skip >+ } >+ } >+ } catch (JavaModelException e) { >+ // skip >+ } >+ } >+ } >+ } > } > > /** >Index: model/org/eclipse/jdt/internal/core/DeltaProcessor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java,v >retrieving revision 1.294 >diff -u -r1.294 DeltaProcessor.java >--- model/org/eclipse/jdt/internal/core/DeltaProcessor.java 23 Feb 2007 15:25:59 -0000 1.294 >+++ model/org/eclipse/jdt/internal/core/DeltaProcessor.java 27 Feb 2007 11:52:05 -0000 >@@ -2189,17 +2189,11 @@ > break; > } > break; >- case IResource.FOLDER : >- /* check settings change */ >- IFolder folder = (IFolder) resource; >- processChildren = folder.getName().equals(JavaProject.DEFAULT_PREFERENCES_DIRNAME); >- break; > case IResource.FILE : > /* check classpath or prefs files change */ > IFile file = (IFile) resource; > String fileName = file.getName(); >- if (fileName.equals(JavaProject.CLASSPATH_FILENAME) || >- fileName.equals(JavaProject.JAVA_CORE_PREFS_FILE)) { >+ if (fileName.equals(JavaProject.CLASSPATH_FILENAME)) { > JavaProject javaProject = (JavaProject)JavaCore.create(file.getProject()); > this.state.addClasspathValidation(javaProject); > affectedProjects.add(file.getProject().getFullPath());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 172345
:
58245
|
58674
| 59863