Commit 43a382ad authored by Romain Bioteau's avatar Romain Bioteau Committed by Romain Bioteau

tr(Datasource): Use auto_server mode for H2 jdbc URL (#157)

* Store the bitronix configuration in the repository database folder

fixes [BS-15734](https://bonitasoft.atlassian.net/browse/BS-15734)
parent 4e531794
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Business Object Plugin
Bundle-Localization: plugin
Bundle-SymbolicName: org.bonitasoft.studio.businessobject;singleton:=true
Bundle-Version: 7.4.0.qualifier
Bundle-Activator: org.bonitasoft.studio.businessobject.BusinessObjectPlugin
Bundle-Vendor: BonitaSoft S.A.
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.bonitasoft.studio.businessobject.core.operation,
org.bonitasoft.studio.businessobject.core.repository,
org.bonitasoft.studio.businessobject.ui,
org.bonitasoft.studio.businessobject.ui.wizard
Require-Bundle: org.bonitasoft.studio.engine;bundle-version="1.0.0",
org.bonitasoft.studio.model;bundle-version="1.0.0",
org.bonitasoft.studio.common;bundle-version="1.0.0",
......@@ -43,10 +45,12 @@ Require-Bundle: org.bonitasoft.studio.engine;bundle-version="1.0.0",
com.google.guava,
org.eclipse.e4.core.services,
org.eclipse.osgi.services;bundle-version="3.4.0",
org.eclipse.jdt.launching
Export-Package: org.bonitasoft.studio.businessobject.core.operation,or
g.bonitasoft.studio.businessobject.core.repository,org.bonitasoft.stu
dio.businessobject.ui,org.bonitasoft.studio.businessobject.ui.wizard
org.eclipse.jdt.launching,
org.eclipse.e4.ui.model.workbench;bundle-version="1.1.0.v20140512-1820",
org.eclipse.e4.core.di;bundle-version="1.4.0",
org.eclipse.e4.core.di.extensions;bundle-version="0.12.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Import-Package: org.bonitasoft.engine.api,
org.bonitasoft.engine.bdm,
org.bonitasoft.engine.bdm.dao,
......
source.. = src/
src.excludes = src-test/resources/,\
src-test/java/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
icons/,\
plugin*.properties,\
messages*.properties
src.excludes = src-test/resources/,\
src-test/java/
messages*.properties,\
fragment.e4xmi
source.. = src/
<?xml version="1.0" encoding="ASCII"?>
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmi:id="_QHAmsGhGEea_RMV0DBK5kg">
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_Zz2fcGhGEea_RMV0DBK5kg" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
<elements xsi:type="commands:Handler" xmi:id="_giWXwGhGEea_RMV0DBK5kg" elementId="org.bonitasoft.studio.businessobject.handler" contributionURI="bundleclass://org.bonitasoft.studio.businessobject/org.bonitasoft.studio.businessobject.ui.handler.OpenH2ConsoleHandler" command="_2hZB8GhGEea_RMV0DBK5kg"/>
</fragments>
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_08KwkGhGEea_RMV0DBK5kg" featurename="commands" parentElementId="org.eclipse.e4.legacy.ide.application">
<elements xsi:type="commands:Command" xmi:id="_2hZB8GhGEea_RMV0DBK5kg" elementId="org.bonitasoft.studio.businessobject.openH2Console" commandName="%openH2Console"/>
</fragments>
</fragment:ModelFragments>
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.bonitasoft.studio.repositoryStore">
<repositoryStore
......@@ -11,48 +11,43 @@
point="org.eclipse.ui.commands">
<command
defaultHandler="org.bonitasoft.studio.businessobject.ui.handler.ManageBusinessObjectHandler"
id="org.bonitasoft.studio.businessobject.manage"
name="%manageBusinessObjects">
name="%manageBusinessObjects"
id="org.bonitasoft.studio.businessobject.manage">
</command>
<command
defaultHandler="org.bonitasoft.studio.businessobject.ui.handler.ExportBusinessDataModelHandler"
id="org.bonitasoft.studio.businessobject.exportCommand"
name="%Export">
</command>
<command
defaultHandler="org.bonitasoft.studio.businessobject.ui.handler.OpenH2ConsoleHandler"
id="org.bonitasoft.studio.businessobject.openH2Console"
name="%openH2Console">
name="%Export"
id="org.bonitasoft.studio.businessobject.exportCommand">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.bonitasoft.studio.development?after=org.bonitasoft.studio.menu.filter">
<menu
icon="icons/bdm.png"
id="org.bonitasoft.studio.businessobject.menu"
label="%BusinessDataModel">
<command
commandId="org.bonitasoft.studio.businessobject.manage"
icon="icons/manage-bdm.png"
id="org.bonitasoft.studio.businessobject.manage.menu"
style="push">
</command>
<command
commandId="org.bonitasoft.studio.businessobject.openH2Console"
style="push">
</command>
<separator
name="org.bonitasoft.studio.businessobject.separator"
visible="true">
</separator>
<command
commandId="org.bonitasoft.studio.businessobject.exportCommand"
icon="icons/export-bdm.png"
style="push">
</command>
</menu>
<menu
label="%BusinessDataModel"
icon="icons/bdm.png"
id="org.bonitasoft.studio.businessobject.menu">
<command
commandId="org.bonitasoft.studio.businessobject.manage"
icon="icons/manage-bdm.png"
style="push"
id="org.bonitasoft.studio.businessobject.manage.menu">
</command>
<command
commandId="org.bonitasoft.studio.businessobject.openH2Console"
style="push">
</command>
<separator
name="org.bonitasoft.studio.businessobject.separator"
visible="true">
</separator>
<command
commandId="org.bonitasoft.studio.businessobject.exportCommand"
icon="icons/export-bdm.png"
style="push">
</command>
</menu>
</menuContribution>
</extension>
<extension
......@@ -90,4 +85,12 @@
type="TYPE_VARIABLE">
</proposalListner>
</extension>
<extension
id="org.bonitasoft.studio.businessobject.fragment"
point="org.eclipse.e4.workbench.model">
<fragment
uri="fragment.e4xmi">
</fragment>
</extension>
</plugin>
......@@ -15,11 +15,9 @@
package org.bonitasoft.studio.businessobject.ui.handler;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.notNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import java.io.File;
......@@ -27,13 +25,15 @@ import java.io.FileNotFoundException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import org.eclipse.core.runtime.IStatus;
import org.bonitasoft.studio.common.repository.RepositoryAccessor;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
......@@ -44,13 +44,21 @@ public class OpenH2ConsoleHandlerTest {
@Mock
private Runtime runtime;
@Mock
private RepositoryAccessor repositoryAccessor;
@Mock
private Process process;
@Spy
private OpenH2ConsoleHandler openH2ConsoleHandler;
@Before
public void setUp() throws Exception {
doReturn("/test/h2_db").when(openH2ConsoleHandler).pathToDBFolder(repositoryAccessor);
doReturn(rootFile()).when(openH2ConsoleHandler).rootFile(repositoryAccessor);
}
@Test
public void should_locate_h2_jar_from_tomcat_folder() throws Exception {
final OpenH2ConsoleHandler openH2ConsoleHandler = new OpenH2ConsoleHandler();
final String path = openH2ConsoleHandler.locateH2jar(rootFile());
final String path = openH2ConsoleHandler.locateH2jar(repositoryAccessor);
assertThat(path).contains("tomcat");
}
......@@ -61,41 +69,39 @@ public class OpenH2ConsoleHandlerTest {
@Test
public void should_throw_FileNotFoundException_if_h2_jar_is_missing() throws Exception {
final OpenH2ConsoleHandler openH2ConsoleHandler = new OpenH2ConsoleHandler();
doReturn(new File(OpenH2ConsoleHandlerTest.class.getResource("/workspaceWithoutH2").toURI().toURL().getFile())).when(openH2ConsoleHandler)
.rootFile(repositoryAccessor);
expectedException.expect(FileNotFoundException.class);
openH2ConsoleHandler.locateH2jar(new File(OpenH2ConsoleHandlerTest.class.getResource("/workspaceWithoutH2").toURI().toURL().getFile()));
openH2ConsoleHandler.locateH2jar(repositoryAccessor);
}
@Test
public void should_destroy_processes_on_shutdown() throws Exception {
final OpenH2ConsoleHandler openH2ConsoleHandler = spy(new OpenH2ConsoleHandler());
doReturn(runtime).when(openH2ConsoleHandler).getRuntime();
doReturn(process).when(runtime).exec(anyString());
doReturn(rootFile()).when(openH2ConsoleHandler).rootFile();
doReturn("h2.jar").when(openH2ConsoleHandler).locateH2jar(any(File.class));
doReturn(rootFile()).when(openH2ConsoleHandler).rootFile(repositoryAccessor);
doReturn("h2.jar").when(openH2ConsoleHandler).locateH2jar(repositoryAccessor);
openH2ConsoleHandler.execute(null);
openH2ConsoleHandler.execute(repositoryAccessor);
verify(runtime).addShutdownHook(notNull(Thread.class));
}
@Test
public void should_execute_java_command() throws Exception {
final OpenH2ConsoleHandler openH2ConsoleHandler = spy(new OpenH2ConsoleHandler());
doReturn(runtime).when(openH2ConsoleHandler).getRuntime();
doReturn(rootFile()).when(openH2ConsoleHandler).rootFile();
doReturn("h2.jar").when(openH2ConsoleHandler).locateH2jar(any(File.class));
doReturn(rootFile()).when(openH2ConsoleHandler).rootFile(repositoryAccessor);
doReturn("h2.jar").when(openH2ConsoleHandler).locateH2jar(repositoryAccessor);
final Object status = openH2ConsoleHandler.execute(null);
openH2ConsoleHandler.execute(repositoryAccessor);
assertThat(status).isEqualTo(IStatus.OK);
final ArgumentCaptor<String> argument = ArgumentCaptor.forClass(String.class);
verify(runtime).exec(argument.capture());
assertThat(argument.getValue()).contains("-webPort").startsWith("java -jar h2.jar -browser").endsWith(
"-tcp -user sa -url jdbc:h2:tcp://localhost:9091/business_data.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE;IGNORECASE=TRUE; -driver org.h2.Driver");
"-tcp -user sa -url jdbc:h2:file:/test/h2_db/business_data.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE;IGNORECASE=TRUE;AUTO_SERVER=TRUE; -driver org.h2.Driver");
}
}
/**
* Copyright (C) 2015 Bonitasoft S.A.
* Copyright (C) 2016 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -23,47 +23,39 @@ import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.bonitasoft.studio.common.repository.RepositoryAccessor;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.jdt.launching.SocketUtil;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.base.Predicate;
/**
* @author Romain Bioteau
*
*/
public class OpenH2ConsoleHandler extends AbstractHandler {
public class OpenH2ConsoleHandler{
private static final String URL = "jdbc:h2:tcp://localhost:9091/business_data.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE;IGNORECASE=TRUE;";
private static final String URL = "jdbc:h2:file:%s/business_data.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE;IGNORECASE=TRUE;AUTO_SERVER=TRUE;";
private static final String DRIVER = "org.h2.Driver";
private static final String USER = "sa";
private static final int PORT = SocketUtil.findFreePort();
/*
* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
@Execute
public void execute(final RepositoryAccessor repositoryAccessor) throws ExecutionException {
try {
final String h2JarPath = locateH2jar(
rootFile());
final String h2JarPath = locateH2jar(repositoryAccessor);
final Process process = getRuntime()
.exec(String.format("java -jar %s -browser -webPort %s -tcp -user %s -url %s -driver %s", h2JarPath, PORT,
USER, URL, DRIVER));
USER,
String.format(URL, pathToDBFolder(repositoryAccessor)),
DRIVER));
getRuntime().addShutdownHook(exitProcessHook(process));
} catch (final IOException e) {
throw new ExecutionException("Failed to locate h2 jar", e);
}
return IStatus.OK;
}
protected String pathToDBFolder(final RepositoryAccessor repositoryAccessor) {
return repositoryAccessor.getCurrentRepository().getDatabaseHandler().getDBLocation().getAbsolutePath();
}
private Thread exitProcessHook(final Process process) {
......@@ -78,15 +70,12 @@ public class OpenH2ConsoleHandler extends AbstractHandler {
};
}
protected File rootFile() {
return RepositoryManager.getInstance().getCurrentRepository().getProject().getWorkspace().getRoot().getLocation().toFile();
}
protected Runtime getRuntime() {
return Runtime.getRuntime();
}
protected String locateH2jar(File root) throws IOException {
protected String locateH2jar(RepositoryAccessor repositoryAccessor) throws IOException {
final File root = rootFile(repositoryAccessor);
final Path path = Paths.get(root.toURI()).resolve(Paths.get("tomcat", "lib", "bonita"));
final Optional<File> candidate = tryFind(fileTreeTraverser().children(path.toFile()), h2Jar());
if (!candidate.isPresent()) {
......@@ -95,6 +84,10 @@ public class OpenH2ConsoleHandler extends AbstractHandler {
return candidate.get().getAbsolutePath();
}
protected File rootFile(RepositoryAccessor repositoryAccessor) {
return repositoryAccessor.getWorkspace().getRoot().getLocation().toFile();
}
private Predicate<? super File> h2Jar() {
return new Predicate<File>() {
......
......@@ -22,7 +22,7 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import org.bonitasoft.studio.common.extension.ExtensionContextInjectionFactory;
import org.bonitasoft.studio.common.repository.core.BonitaHomeHandler;
import org.bonitasoft.studio.common.repository.core.DatabaseHandler;
import org.bonitasoft.studio.common.repository.core.ProjectClasspathFactory;
import org.bonitasoft.studio.common.repository.core.ProjectManifestFactory;
import org.bonitasoft.studio.common.repository.jdt.JDTTypeHierarchyManager;
......@@ -52,7 +52,7 @@ public class RepositoryTest {
@Mock
private ProjectClasspathFactory bonitaBPMProjectClasspath;
@Mock
private BonitaHomeHandler bonitaHomeHandler;
private DatabaseHandler bonitaHomeHandler;
@Test
public void should_open_trigger_project_manifest_factory() throws Exception {
......@@ -95,7 +95,7 @@ public class RepositoryTest {
private Repository newRepository() {
final Repository repo = spy(new Repository(workspace, project, extensionContextInjectionFactory, jdtTypeHierarchyManager, projectManifestFactory,
bonitaBPMProjectClasspath, true));
doReturn(bonitaHomeHandler).when(repo).getBonitaHomeHandler();
doReturn(bonitaHomeHandler).when(repo).getDatabaseHandler();
return repo;
}
......
/**
* Copyright (C) 2016 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.common.repository.core;
import static com.google.common.io.Files.newInputStreamSupplier;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.File;
import java.util.Properties;
import org.eclipse.core.resources.IProject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class DatabaseHandlerTest {
@Rule
public TemporaryFolder tmpFolder = new TemporaryFolder();
@Test
public void should_create_bitronix_resource_properties() throws Exception {
final IProject project = mock(IProject.class, RETURNS_DEEP_STUBS);
final File rootFolder = tmpFolder.newFolder();
when(project.getLocation().toFile()).thenReturn(rootFolder);
final DatabaseHandler databaseHandler = new DatabaseHandler(project);
final File file = databaseHandler.createBitronixConfFile();
final Properties properties = new Properties();
properties.load(newInputStreamSupplier(file).getInput());
assertThat(properties).contains(
entry("resource.ds1.driverProperties.URL",
String.format("jdbc:h2:file:%s/h2_database/bonita_journal.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=FALSE;IGNORECASE=TRUE;AUTO_SERVER=TRUE;",
rootFolder.getAbsolutePath())),
entry("resource.ds2.driverProperties.URL",
String.format("jdbc:h2:file:%s/h2_database/business_data.db;MVCC=TRUE;DB_CLOSE_ON_EXIT=FALSE;IGNORECASE=TRUE;AUTO_SERVER=TRUE;",
rootFolder.getAbsolutePath())),
entry("allowLocalTransactions", "true"),
entry("resource.ds1.uniqueName", "jdbc/bonitaDSXA"),
entry("resource.ds2.uniqueName", "jdbc/BusinessDataDSXA"));
}
}
......@@ -40,8 +40,8 @@ import org.bonitasoft.studio.common.extension.BonitaStudioExtensionRegistryManag
import org.bonitasoft.studio.common.extension.ExtensionContextInjectionFactory;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.core.BonitaBPMProjectMigrationOperation;
import org.bonitasoft.studio.common.repository.core.BonitaHomeHandler;
import org.bonitasoft.studio.common.repository.core.CreateBonitaBPMProjectOperation;
import org.bonitasoft.studio.common.repository.core.DatabaseHandler;
import org.bonitasoft.studio.common.repository.core.ProjectClasspathFactory;
import org.bonitasoft.studio.common.repository.core.ProjectManifestFactory;
import org.bonitasoft.studio.common.repository.filestore.FileStoreChangeEvent;
......@@ -289,7 +289,7 @@ public class Repository implements IRepository, IJavaContainer {
isLoaded = false;
if (stores == null || stores.isEmpty()) {
disableBuild();
stores = new TreeMap<Class<?>, IRepositoryStore<? extends IRepositoryFileStore>>(new Comparator<Class<?>>() {
stores = new TreeMap<>(new Comparator<Class<?>>() {
@Override
public int compare(final Class<?> o1, final Class<?> o2) {
......@@ -469,14 +469,14 @@ public class Repository implements IRepository, IJavaContainer {
initRepositoryStores(NULL_PROGRESS_MONITOR);
enableBuild();
}
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<IRepositoryStore<? extends IRepositoryFileStore>>(stores.values());
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<>(stores.values());
Collections.sort(result, new RepositoryStoreComparator());
return result;
}
@Override
public List<IRepositoryStore<? extends IRepositoryFileStore>> getAllSharedStores() {
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<IRepositoryStore<? extends IRepositoryFileStore>>();
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<>();
for (final IRepositoryStore<? extends IRepositoryFileStore> sotre : getAllStores()) {
if (sotre.isShared()) {
result.add(sotre);
......@@ -504,7 +504,7 @@ public class Repository implements IRepository, IJavaContainer {
public void exportToArchive(final String fileName) {
final ExportBosArchiveOperation operation = new ExportBosArchiveOperation();
operation.setDestinationPath(fileName);
final Set<IResource> allResources = new HashSet<IResource>();
final Set<IResource> allResources = new HashSet<>();
for (final IRepositoryStore<?> store : getAllExportableStores()) {
allResources.add(store.getResource());
allResources.addAll(allRelatedResources(store));
......@@ -519,7 +519,7 @@ public class Repository implements IRepository, IJavaContainer {
}
private List<IResource> allRelatedResources(final IRepositoryStore<?> store) {
final List<IResource> relatedResources = new ArrayList<IResource>();
final List<IResource> relatedResources = new ArrayList<>();
for (final IRepositoryFileStore fs : store.getChildren()) {
for (final IRepositoryFileStore related : fs.getRelatedFileStore()) {
relatedResources.add(related.getResource());
......@@ -578,7 +578,7 @@ public class Repository implements IRepository, IJavaContainer {
@Override
public List<IRepositoryStore<? extends IRepositoryFileStore>> getAllShareableStores() {
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<IRepositoryStore<? extends IRepositoryFileStore>>();
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<>();
for (final IRepositoryStore<? extends IRepositoryFileStore> store : getAllStores()) {
if (store.canBeShared()) {
result.add(store);
......@@ -591,7 +591,7 @@ public class Repository implements IRepository, IJavaContainer {
@Override
public ClassLoader createProjectClassloader(final IProgressMonitor monitor) {
final List<URL> jars = new ArrayList<URL>();
final List<URL> jars = new ArrayList<>();
try {
final ProjectClasspathFactory bonitaBPMProjectClasspath = new ProjectClasspathFactory();
if (!bonitaBPMProjectClasspath.classpathExists(this)) {
......@@ -630,7 +630,7 @@ public class Repository implements IRepository, IJavaContainer {
@Override
public List<IRepositoryStore<? extends IRepositoryFileStore>> getAllExportableStores() {
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<IRepositoryStore<? extends IRepositoryFileStore>>();
final List<IRepositoryStore<? extends IRepositoryFileStore>> result = new ArrayList<>();
for (final IRepositoryStore<? extends IRepositoryFileStore> store : getAllStores()) {
if (store.canBeExported()) {
result.add(store);
......@@ -744,8 +744,8 @@ public class Repository implements IRepository, IJavaContainer {
}
@Override
public BonitaHomeHandler getBonitaHomeHandler() {
return new BonitaHomeHandler(getProject());
public DatabaseHandler getDatabaseHandler() {
return new DatabaseHandler(getProject());
}
}
/**
* Copyright (C) 2016 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warran