Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Dumoulin2014-08-05 10:12:43 +0000
committerGerrit Code Review @ Eclipse.org2014-08-05 10:12:43 +0000
commitc003a8c77c74bfdbae5dd0be441a70bd276b5541 (patch)
treedd88c4676d00bcc68bfbe3af00ca26c760f34154 /extraplugins
parenta3bbd4df1ec81a34223efdef97e0505deede8969 (diff)
parent32bfc1632a9589c1899f10f00bfdb05c5f95c32f (diff)
downloadorg.eclipse.papyrus-c003a8c77c74bfdbae5dd0be441a70bd276b5541.tar.gz
org.eclipse.papyrus-c003a8c77c74bfdbae5dd0be441a70bd276b5541.tar.xz
org.eclipse.papyrus-c003a8c77c74bfdbae5dd0be441a70bd276b5541.zip
Merge "Bug 438514 - [java code generation] java generation should open the target project when it's closed"
Diffstat (limited to 'extraplugins')
-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 83174f1a61f..2908c9ddc6c 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);

Back to the top