summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan GEOFFROY2014-07-04 04:51:33 (EDT)
committerJonathan GEOFFROY2014-07-04 04:51:33 (EDT)
commit32bfc1632a9589c1899f10f00bfdb05c5f95c32f (patch)
treeaa74a16edc3f52513961d818887437123598651d
parent051d2bd37ad35ab20eef14860dfe33528ff995f1 (diff)
downloadorg.eclipse.papyrus-32bfc1632a9589c1899f10f00bfdb05c5f95c32f.zip
org.eclipse.papyrus-32bfc1632a9589c1899f10f00bfdb05c5f95c32f.tar.gz
org.eclipse.papyrus-32bfc1632a9589c1899f10f00bfdb05c5f95c32f.tar.bz2
Bug 438514 - [java code generation] java generation should open therefs/changes/56/29456/1
target project when it's closed Change-Id: Ifa04c0c63ba031e96b2730f04e6655726be97ab9 Signed-off-by: Jonathan GEOFFROY <geoffroy.jonathan@gmail.com>
-rw-r--r--extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java
index 83174f1..2908c9d 100644
--- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java
+++ b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java
@@ -82,23 +82,26 @@ public class SynchJDTJavaProject implements JDTVisitor {
// search IJavaProject
//IProject projet = iroot.getProject(project.getElementName());
IJavaProject ijavaProjet = ijm.getJavaProject(project.getElementName());
+ IProject proj;
// if ijavaProjet don't exist, create this!
if(!ijavaProjet.exists()) {
- // System.out.println("create the project " + project.getElementName());
- IProject proj = iroot.getProject(project.getElementName());
-
try {
- proj.create(null);
- proj.open(null);
+ proj = iroot.getProject(project.getElementName());
+ if(!proj.exists()) {
+ proj.create(null);
+ proj.open(null);
+ } else if(!proj.isOpen()) {
+ proj.open(null);
+ }
// Specifies type of project
IProjectDescription description = proj.getDescription();
description.setNatureIds(new String[]{ JavaCore.NATURE_ID });
proj.setDescription(description, null);
} catch (CoreException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
+ throw new JDTVisitorException(e.getMessage());
}
ijavaProjet = JavaCore.create(proj);