Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-studio
Commits
e47e1482
Commit
e47e1482
authored
Dec 14, 2015
by
Romain Bioteau
Browse files
Open project before checking nature
parent
a08bc8a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
bundles/plugins/org.bonitasoft.studio.common.repository/src/org/bonitasoft/studio/common/repository/RepositoryManager.java
View file @
e47e1482
...
...
@@ -132,13 +132,29 @@ public class RepositoryManager {
public
Repository
getRepository
(
final
String
repositoryName
,
final
boolean
migrationEnabled
)
{
final
IWorkspace
workspace
=
ResourcesPlugin
.
getWorkspace
();
final
IProject
project
=
workspace
.
getRoot
().
getProject
(
repositoryName
);
if
(
project
==
null
||
!
project
.
exists
())
{
return
null
;
}
boolean
toClose
=
false
;
try
{
if
(
project
==
null
||
!
project
.
exists
()
||
!
project
.
hasNature
(
BonitaProjectNature
.
NATURE_ID
))
{
if
(!
project
.
isAccessible
())
{
project
.
open
(
Repository
.
NULL_PROGRESS_MONITOR
);
toClose
=
true
;
}
if
(!
project
.
hasNature
(
BonitaProjectNature
.
NATURE_ID
))
{
return
null
;
}
}
catch
(
final
CoreException
e
)
{
BonitaStudioLog
.
error
(
e
);
return
null
;
}
finally
{
if
(
toClose
)
{
try
{
project
.
close
(
Repository
.
NULL_PROGRESS_MONITOR
);
}
catch
(
final
CoreException
e
)
{
BonitaStudioLog
.
error
(
e
);
}
}
}
return
createRepository
(
repositoryName
,
migrationEnabled
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment