coverity suggested changes

This commit is contained in:
Jeremy Long
2017-06-24 15:58:33 -04:00
parent c555f60f47
commit 5bc1c3f616
2 changed files with 4 additions and 4 deletions

View File

@@ -1014,7 +1014,7 @@ public class Check extends Update {
* *
* @throws BuildException if the task was not configured correctly. * @throws BuildException if the task was not configured correctly.
*/ */
private void validateConfiguration() throws BuildException { private synchronized void validateConfiguration() throws BuildException {
if (path == null) { if (path == null) {
throw new BuildException("No project dependencies have been defined to analyze."); throw new BuildException("No project dependencies have been defined to analyze.");
} }

View File

@@ -137,7 +137,7 @@ public final class CpeMemoryIndex {
* *
* @return whether or not the index is open * @return whether or not the index is open
*/ */
public boolean isOpen() { public synchronized boolean isOpen() {
return openState; return openState;
} }
@@ -274,7 +274,7 @@ public final class CpeMemoryIndex {
* @return the Document * @return the Document
* @throws IOException thrown if there is an IOException * @throws IOException thrown if there is an IOException
*/ */
public Document getDocument(int documentId) throws IOException { public synchronized Document getDocument(int documentId) throws IOException {
return indexSearcher.doc(documentId); return indexSearcher.doc(documentId);
} }
@@ -283,7 +283,7 @@ public final class CpeMemoryIndex {
* *
* @return the number of CPE entries stored in the index * @return the number of CPE entries stored in the index
*/ */
public int numDocs() { public synchronized int numDocs() {
if (indexReader == null) { if (indexReader == null) {
return -1; return -1;
} }