Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjay2018-12-04 18:55:11 +0000
committerjay2018-12-05 09:00:37 +0000
commit656a7f631fb76e187296f81dcd900dfff9ff6a65 (patch)
treefe99f1dd4ca496289e39839388017d185b7d8b3e /org.eclipse.jdt.apt.pluggable.core
parentbff823d336ce03dac0d247c2ec5ced05ed4343ba (diff)
downloadeclipse.jdt.core-656a7f631fb76e187296f81dcd900dfff9ff6a65.tar.gz
eclipse.jdt.core-656a7f631fb76e187296f81dcd900dfff9ff6a65.tar.xz
eclipse.jdt.core-656a7f631fb76e187296f81dcd900dfff9ff6a65.zip
Bug 542090 - FilerException: Source file already createdI20181206-0320I20181206-0225I20181206-0030I20181205-1800
Change-Id: I18e92e5ad1eaafae9230b2718ac872e5cf5f1891 Signed-off-by: jay <jarthana@in.ibm.com>
Diffstat (limited to 'org.eclipse.jdt.apt.pluggable.core')
-rw-r--r--org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeFilerImpl.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeFilerImpl.java b/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeFilerImpl.java
index 75c763378e..4f6fa75189 100644
--- a/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeFilerImpl.java
+++ b/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/filer/IdeFilerImpl.java
@@ -54,12 +54,12 @@ import org.eclipse.jdt.internal.compiler.lookup.TagBits;
*/
public class IdeFilerImpl implements Filer {
- //private final IdeAnnotationProcessorManager _dispatchManager;
+ private final IdeAnnotationProcessorManager _dispatchManager;
private final IdeProcessingEnvImpl _env;
public IdeFilerImpl(IdeAnnotationProcessorManager dispatchManager,
IdeProcessingEnvImpl env) {
- //_dispatchManager = dispatchManager;
+ _dispatchManager = dispatchManager;
_env = env;
}
@@ -174,7 +174,14 @@ public class IdeFilerImpl implements Filer {
m = _env.getCompiler().lookupEnvironment.UnNamedModule;
ReferenceBinding type = m.environment.getType(CharOperation.splitOn('.', name.toString().toCharArray()), m);
if (type != null && (type.tagBits & TagBits.HasMissingType) == 0) {
- throw new FilerException("Source file already exists : " + name); //$NON-NLS-1$
+ IFile classFile = getFileFromOutputLocation(StandardLocation.CLASS_OUTPUT, CharOperation.toString(type.fPackage.compoundName), new String(type.sourceName()) + ".class");
+ String fileName = new String(type.getFileName());
+ if (fileName != null) {
+ String osString = classFile.getFullPath().toOSString();
+ if (!osString.equals(fileName) || !_dispatchManager._isFirstRound) {
+ throw new FilerException("Source file already exists : " + name); //$NON-NLS-1$
+ }
+ }
}
Set<IFile> parentFiles = Collections.emptySet();
if (originatingElements != null && originatingElements.length > 0) {

Back to the top