Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thomann2007-01-03 02:35:52 +0000
committerOlivier Thomann2007-01-03 02:35:52 +0000
commit57effdfbf8500b1bf7932afcc270c4183c0fd5bb (patch)
tree11e29ac3a01907b0a4bf1b302a566b7838438c23 /org.eclipse.jdt.compiler.tool
parentaa852841b1dd73414418bf5fc5420a74b80d0cd9 (diff)
downloadeclipse.jdt.core-57effdfbf8500b1bf7932afcc270c4183c0fd5bb.tar.gz
eclipse.jdt.core-57effdfbf8500b1bf7932afcc270c4183c0fd5bb.tar.xz
eclipse.jdt.core-57effdfbf8500b1bf7932afcc270c4183c0fd5bb.zip
HEAD - Patch for apt
Diffstat (limited to 'org.eclipse.jdt.compiler.tool')
-rw-r--r--org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java3
-rw-r--r--org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java15
2 files changed, 12 insertions, 6 deletions
diff --git a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java
index 33175c4c50..a1cae75c13 100644
--- a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java
+++ b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java
@@ -361,7 +361,8 @@ public class EclipseCompiler extends Main implements JavaCompiler {
@Override
protected void initializeAnnotationProcessorManager() {
super.initializeAnnotationProcessorManager();
- if (this.batchCompiler.annotationProcessorManager != null) {
+ if (this.batchCompiler.annotationProcessorManager != null &&
+ this.processors != null) {
this.batchCompiler.annotationProcessorManager.setProcessors(this.processors);
} else if (this.processors != null) {
throw new UnsupportedOperationException("Cannot handle annotation processing"); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
index 08466d1891..b8b161dad5 100644
--- a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
+++ b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
@@ -46,6 +46,7 @@ public class EclipseFileManager implements StandardJavaFileManager {
static final int HAS_EXT_DIRS = 1;
static final int HAS_BOOTCLASSPATH = 2;
static final int HAS_ENDORSED_DIRS = 4;
+ static final int HAS_PROCESSORPATH = 8;
Map<File, Archive> archivesCache;
Charset charset;
@@ -616,7 +617,12 @@ public class EclipseFileManager implements StandardJavaFileManager {
remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> classpaths = getPathsFrom(remaining.next());
- if (classpaths != null) setLocation(StandardLocation.CLASS_PATH, classpaths);
+ if (classpaths != null) {
+ setLocation(StandardLocation.CLASS_PATH, classpaths);
+ if ((this.flags & HAS_PROCESSORPATH) == 0) {
+ setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, classpaths);
+ }
+ }
remaining.remove();
return true;
} else {
@@ -696,16 +702,15 @@ public class EclipseFileManager implements StandardJavaFileManager {
throw new IllegalArgumentException();
}
}
- if ("-processorpath".equals(current) || "-cp".equals(current)) {//$NON-NLS-1$//$NON-NLS-2$
+ if ("-processorpath".equals(current)) {//$NON-NLS-1$
remaining.remove(); // remove the current option
if (remaining.hasNext()) {
final Iterable<? extends File> processorpaths = getPathsFrom(remaining.next());
if (processorpaths != null) {
- Iterable<? extends File> iterable = getLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH);
- setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH,
- prependFiles(iterable, processorpaths));
+ setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, processorpaths);
}
remaining.remove();
+ this.flags |= HAS_PROCESSORPATH;
return true;
} else {
throw new IllegalArgumentException();

Back to the top