mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-30 05:42:10 +02:00
Merge branch 'master' of github.com:jeremylong/DependencyCheck
This commit is contained in:
@@ -128,7 +128,7 @@ public class Engine implements FileFilter, AutoCloseable {
|
|||||||
*
|
*
|
||||||
* @return whether or not the database is required
|
* @return whether or not the database is required
|
||||||
*/
|
*/
|
||||||
public boolean isDatabseRequired() {
|
private boolean isDatabaseRequired() {
|
||||||
return databaseRequired;
|
return databaseRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,7 +254,7 @@ public class Engine implements FileFilter, AutoCloseable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
if (mode.isDatabseRequired()) {
|
if (mode.isDatabaseRequired()) {
|
||||||
if (database != null) {
|
if (database != null) {
|
||||||
database.close();
|
database.close();
|
||||||
database = null;
|
database = null;
|
||||||
@@ -699,7 +699,7 @@ public class Engine implements FileFilter, AutoCloseable {
|
|||||||
* @throws ExceptionCollection thrown if fatal exceptions occur
|
* @throws ExceptionCollection thrown if fatal exceptions occur
|
||||||
*/
|
*/
|
||||||
private void initializeAndUpdateDatabase(final List<Throwable> exceptions) throws ExceptionCollection {
|
private void initializeAndUpdateDatabase(final List<Throwable> exceptions) throws ExceptionCollection {
|
||||||
if (!mode.isDatabseRequired()) {
|
if (!mode.isDatabaseRequired()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
boolean autoUpdate = true;
|
boolean autoUpdate = true;
|
||||||
@@ -869,7 +869,7 @@ public class Engine implements FileFilter, AutoCloseable {
|
|||||||
* @throws UpdateException thrown if the operation fails
|
* @throws UpdateException thrown if the operation fails
|
||||||
*/
|
*/
|
||||||
public void doUpdates(boolean remainOpen) throws UpdateException {
|
public void doUpdates(boolean remainOpen) throws UpdateException {
|
||||||
if (mode.isDatabseRequired()) {
|
if (mode.isDatabaseRequired()) {
|
||||||
H2DBLock dblock = null;
|
H2DBLock dblock = null;
|
||||||
try {
|
try {
|
||||||
if (ConnectionFactory.isH2Connection(settings)) {
|
if (ConnectionFactory.isH2Connection(settings)) {
|
||||||
@@ -930,7 +930,7 @@ public class Engine implements FileFilter, AutoCloseable {
|
|||||||
* opening the database
|
* opening the database
|
||||||
*/
|
*/
|
||||||
public void openDatabase(boolean readOnly, boolean lockRequired) {
|
public void openDatabase(boolean readOnly, boolean lockRequired) {
|
||||||
if (mode.isDatabseRequired() && database == null) {
|
if (mode.isDatabaseRequired() && database == null) {
|
||||||
//needed to update schema any required schema changes
|
//needed to update schema any required schema changes
|
||||||
database = new CveDB(settings);
|
database = new CveDB(settings);
|
||||||
if (readOnly
|
if (readOnly
|
||||||
@@ -1048,7 +1048,7 @@ public class Engine implements FileFilter, AutoCloseable {
|
|||||||
* @throws NoDataException thrown if no data exists in the CPE Index
|
* @throws NoDataException thrown if no data exists in the CPE Index
|
||||||
*/
|
*/
|
||||||
private void ensureDataExists() throws NoDataException {
|
private void ensureDataExists() throws NoDataException {
|
||||||
if (mode.isDatabseRequired() && (database == null || !database.dataExists())) {
|
if (mode.isDatabaseRequired() && (database == null || !database.dataExists())) {
|
||||||
throw new NoDataException("No documents exist");
|
throw new NoDataException("No documents exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user