Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Johnson2006-06-28 19:37:40 +0000
committerKent Johnson2006-06-28 19:37:40 +0000
commit77f19d125e3f771a739601f7ca17297a6111a564 (patch)
tree345905c135687518cb5060f7d920ae3367404cd0
parentcd3d98bb81cd92419bbd5794301b1a72f0c3c05a (diff)
downloadeclipse.jdt.core-77f19d125e3f771a739601f7ca17297a6111a564.tar.gz
eclipse.jdt.core-77f19d125e3f771a739601f7ca17297a6111a564.tar.xz
eclipse.jdt.core-77f19d125e3f771a739601f7ca17297a6111a564.zip
117302 in 3.2.1
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java32
-rw-r--r--org.eclipse.jdt.core/buildnotes_jdt-core.html4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java49
3 files changed, 48 insertions, 37 deletions
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java
index b89d6e795a..53e144cf7b 100644
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java
+++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/CopyResourceTests.java
@@ -28,6 +28,38 @@ public class CopyResourceTests extends BuilderTests {
return buildTestSuite(CopyResourceTests.class);
}
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=117302
+ public void testFilteredResources() throws JavaModelException {
+ IPath projectPath = env.addProject("P"); //$NON-NLS-1$
+ IPath src = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$
+ env.setOutputFolder(projectPath, "bin"); //$NON-NLS-1$
+ env.addExternalJars(projectPath, Util.getJavaClassLibs());
+
+ env.addClass(src, "x", "A", //$NON-NLS-1$ //$NON-NLS-2$
+ "package x;"+ //$NON-NLS-1$
+ "public class A extends q.B {}" //$NON-NLS-1$
+ );
+ env.addClass(src, "q", "B", //$NON-NLS-1$ //$NON-NLS-2$
+ "package q;"+ //$NON-NLS-1$
+ "public class B {}" //$NON-NLS-1$
+ );
+ env.addFile(src.append("q"), "test.txt", "test file"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ org.eclipse.jdt.core.IJavaProject p = env.getJavaProject("P");
+ java.util.Map options = p.getOptions(true);
+ options.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, "q*"); //$NON-NLS-1$
+ p.setOptions(options);
+
+ int max = org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE;
+ try {
+ org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = 1;
+ fullBuild();
+ } finally {
+ org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.MAX_AT_ONCE = max;
+ }
+ expectingNoProblems();
+ expectingNoPresenceOf(projectPath.append("bin/q/test.txt")); //$NON-NLS-1$
+ }
+
public void testSimpleProject() throws JavaModelException {
IPath projectPath = env.addProject("P1"); //$NON-NLS-1$
IPath src = env.getPackageFragmentRootPath(projectPath, ""); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 66abbfcb2a..f0c2868ef4 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -57,7 +57,9 @@ Eclipse SDK 3.2.1 - ?th September 2006
</ul>
<h3>Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=147875">147875</a>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=117302">117302</a>
+Clean build of large project gives unresolved type errors
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=147875">147875</a>
[1.5][compiler] NPE when initializing annotations of a binary field
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=148523">148523</a>
[batch] Batch compiler output contains extra linebreak before line position
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java
index 9f844fee13..e26ff89ae5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BatchImageBuilder.java
@@ -85,6 +85,9 @@ protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreExcepti
final char[][] exclusionPatterns = sourceLocation.exclusionPatterns;
final char[][] inclusionPatterns = sourceLocation.inclusionPatterns;
final boolean isAlsoProject = sourceLocation.sourceFolder.equals(javaBuilder.currentProject);
+ final int segmentCount = sourceLocation.sourceFolder.getFullPath().segmentCount();
+ final IContainer outputFolder = sourceLocation.binaryFolder;
+ final boolean isOutputFolder = sourceLocation.sourceFolder.equals(outputFolder);
sourceLocation.sourceFolder.accept(
new IResourceProxyVisitor() {
public boolean visit(IResourceProxy proxy) throws CoreException {
@@ -107,7 +110,14 @@ protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreExcepti
resource = proxy.requestResource();
if (Util.isExcluded(resource, inclusionPatterns, exclusionPatterns)) return false;
}
- if (isAlsoProject && isExcludedFromProject(proxy.requestFullPath())) return false;
+ IPath folderPath = null;
+ if (isAlsoProject)
+ if (isExcludedFromProject(folderPath = proxy.requestFullPath())) return false;
+ if (!isOutputFolder) {
+ if (folderPath == null)
+ folderPath = proxy.requestFullPath();
+ createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
+ }
}
return true;
}
@@ -190,10 +200,7 @@ protected void cleanOutputFolders(boolean copyBack) throws CoreException {
},
IResource.NONE
);
- if (!isOutputFolder && copyBack) {
- notifier.checkCancel();
- copyPackages(sourceLocation);
- }
+ notifier.checkCancel();
}
notifier.checkCancel();
}
@@ -202,8 +209,6 @@ protected void cleanOutputFolders(boolean copyBack) throws CoreException {
ClasspathMultiDirectory sourceLocation = sourceLocations[i];
if (sourceLocation.hasIndependentOutputFolder)
copyExtraResourcesBack(sourceLocation, false);
- else if (!sourceLocation.sourceFolder.equals(sourceLocation.binaryFolder))
- copyPackages(sourceLocation); // output folder is different from source folder
notifier.checkCancel();
}
}
@@ -262,6 +267,7 @@ protected void copyExtraResourcesBack(ClasspathMultiDirectory sourceLocation, fi
}
copiedResource.delete(IResource.FORCE, null); // last one wins
}
+ createFolder(partialPath.removeLastSegments(1), outputFolder); // ensure package folder exists
resource.copy(copiedResource.getFullPath(), IResource.FORCE | IResource.DERIVED, null);
Util.setReadOnly(copiedResource, false); // just in case the original was read only
return false;
@@ -272,35 +278,6 @@ protected void copyExtraResourcesBack(ClasspathMultiDirectory sourceLocation, fi
if (isAlsoProject && isExcludedFromProject(folderPath)) return false; // the sourceFolder == project
if (exclusionPatterns != null && Util.isExcluded(resource, inclusionPatterns, exclusionPatterns))
return inclusionPatterns != null; // need to go further only if inclusionPatterns are set
- createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
- }
- return true;
- }
- },
- IResource.NONE
- );
-}
-
-protected void copyPackages(ClasspathMultiDirectory sourceLocation) throws CoreException {
- final int segmentCount = sourceLocation.sourceFolder.getFullPath().segmentCount();
- final char[][] exclusionPatterns = sourceLocation.exclusionPatterns;
- final char[][] inclusionPatterns = sourceLocation.inclusionPatterns;
- final IContainer outputFolder = sourceLocation.binaryFolder;
- final boolean isAlsoProject = sourceLocation.sourceFolder.equals(javaBuilder.currentProject);
- sourceLocation.sourceFolder.accept(
- new IResourceProxyVisitor() {
- public boolean visit(IResourceProxy proxy) throws CoreException {
- switch(proxy.getType()) {
- case IResource.FILE :
- return false;
- case IResource.FOLDER :
- IResource resource = proxy.requestResource();
- if (javaBuilder.filterExtraResource(resource)) return false;
- IPath folderPath = resource.getFullPath();
- if (isAlsoProject && isExcludedFromProject(folderPath)) return false; // the sourceFolder == project
- if (exclusionPatterns != null && Util.isExcluded(resource, inclusionPatterns, exclusionPatterns))
- return inclusionPatterns != null; // need to go further only if inclusionPatterns are set
- createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
}
return true;
}

Back to the top