Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjay2018-06-26 10:36:52 +0000
committerJayaprakash Arthanareeswaran2018-06-28 17:44:45 +0000
commitf668bca61ebe161adbab98cbb94df79497197a1b (patch)
tree4ef9e0ebb0cbf242500e55f93a0bb9bfa63819c8 /org.eclipse.jdt.apt.pluggable.core
parented78da37f7c90478f2f099f0d039c9462797f2af (diff)
downloadeclipse.jdt.core-f668bca61ebe161adbab98cbb94df79497197a1b.tar.gz
eclipse.jdt.core-f668bca61ebe161adbab98cbb94df79497197a1b.tar.xz
eclipse.jdt.core-f668bca61ebe161adbab98cbb94df79497197a1b.zip
Bug 534979 - [11] Add warning in annotation processing on redefiningY20180705-0105
symbols Change-Id: I3054799f2c9f185a5e84b6ae53b7197568a1cf27 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.java15
1 files changed, 13 insertions, 2 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 309fd8652f..e45abeba31 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
@@ -22,9 +22,9 @@ import javax.annotation.processing.Filer;
import javax.annotation.processing.FilerException;
import javax.lang.model.element.Element;
import javax.tools.FileObject;
+import javax.tools.JavaFileManager.Location;
import javax.tools.JavaFileObject;
import javax.tools.StandardLocation;
-import javax.tools.JavaFileManager.Location;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -34,6 +34,8 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.apt.core.internal.AptCompilationParticipant;
import org.eclipse.jdt.apt.core.internal.generatedfile.GeneratedSourceFolderManager;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.apt.pluggable.core.Apt6Plugin;
import org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager;
@@ -128,7 +130,16 @@ public class IdeFilerImpl implements Filer {
if (AptCompilationParticipant.getInstance().getJava6GeneratedFiles().contains(file)) {
throw new FilerException("Source file already created: " + file.getFullPath()); //$NON-NLS-1$
}
-
+ IJavaProject javaProject = _env.getJavaProject();
+ IType type = null;
+ try {
+ name = name.toString().replace('/', '.');
+ type = javaProject.findType(name.toString());
+ } catch (JavaModelException e) {
+ }
+ if (type != null) {
+ throw new FilerException("Source file already exists : " + name); //$NON-NLS-1$
+ }
Set<IFile> parentFiles = Collections.emptySet();
if (originatingElements != null && originatingElements.length > 0) {
parentFiles = new HashSet<IFile>(originatingElements.length);

Back to the top