fixed some finde-bugs issues
This commit is contained in:
parent
b1b582028f
commit
917f55da6f
6 changed files with 21 additions and 6 deletions
|
@ -35,5 +35,19 @@
|
||||||
<Package name="ch.ethz.seb.sebserver.gui.service.page" />
|
<Package name="ch.ethz.seb.sebserver.gui.service.page" />
|
||||||
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
|
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
|
||||||
</Match>
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Package name="ch.ethz.seb.sebserver.gui.service.page" />
|
||||||
|
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Package name="ch.ethz.seb.sebserver.webservice.servicelayer.session.impl.proctoring" />
|
||||||
|
<Bug pattern="URF_UNREAD_FIELD" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Package name="ch.ethz.seb.sebserver.webservice.servicelayer.session.impl.proctoring" />
|
||||||
|
<Bug pattern="SS_SHOULD_BE_STATIC" />
|
||||||
|
</Match>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</FindBugsFilter>
|
</FindBugsFilter>
|
|
@ -100,7 +100,8 @@ public class ClientConnectionData {
|
||||||
while (i1.hasNext()) {
|
while (i1.hasNext()) {
|
||||||
final IndicatorValue iv1 = i1.next();
|
final IndicatorValue iv1 = i1.next();
|
||||||
final IndicatorValue iv2 = i2.next();
|
final IndicatorValue iv2 = i2.next();
|
||||||
if (iv1.getIndicatorId() != iv2.getIndicatorId() || Math.abs(iv1.getValue() - iv2.getValue()) > 0.1) {
|
if (iv1.getIndicatorId().longValue() != iv2.getIndicatorId().longValue() ||
|
||||||
|
Math.abs(iv1.getValue() - iv2.getValue()) > 0.1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -472,7 +472,7 @@ public class ActivitiesPane implements TemplateComposer {
|
||||||
? tree.getSelection()[0]
|
? tree.getSelection()[0]
|
||||||
: (TreeItem) event.item;
|
: (TreeItem) event.item;
|
||||||
|
|
||||||
if (treeItem.getItemCount() > 0 && !treeItem.getExpanded()) {
|
if (treeItem == null || (treeItem.getItemCount() > 0 && !treeItem.getExpanded())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class LmsAPIServiceImpl implements LmsAPIService {
|
||||||
final LmsAPITemplate template = getLmsAPITemplate(lmsSetupId)
|
final LmsAPITemplate template = getLmsAPITemplate(lmsSetupId)
|
||||||
.getOrThrow();
|
.getOrThrow();
|
||||||
|
|
||||||
if (institutionId != null && template.lmsSetup().institutionId != institutionId) {
|
if (institutionId != null && institutionId.equals(template.lmsSetup().institutionId)) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
return template
|
return template
|
||||||
|
|
|
@ -222,7 +222,7 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
|
||||||
|
|
||||||
private List<QuizData> collectAllQuizzes(final OlatLmsRestTemplate restTemplate, final FilterMap filterMap) {
|
private List<QuizData> collectAllQuizzes(final OlatLmsRestTemplate restTemplate, final FilterMap filterMap) {
|
||||||
final LmsSetup lmsSetup = this.apiTemplateDataSupplier.getLmsSetup();
|
final LmsSetup lmsSetup = this.apiTemplateDataSupplier.getLmsSetup();
|
||||||
final String quizName = filterMap.getString(QuizData.FILTER_ATTR_QUIZ_NAME);
|
final String quizName = (filterMap != null) ? filterMap.getString(QuizData.FILTER_ATTR_QUIZ_NAME) : null;
|
||||||
final DateTime quizFromTime = (filterMap != null) ? filterMap.getQuizFromTime() : null;
|
final DateTime quizFromTime = (filterMap != null) ? filterMap.getQuizFromTime() : null;
|
||||||
final long fromCutTime = (quizFromTime != null) ? Utils.toUnixTimeInSeconds(quizFromTime) : -1;
|
final long fromCutTime = (quizFromTime != null) ? Utils.toUnixTimeInSeconds(quizFromTime) : -1;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.sebconfig.impl;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.cert.Certificate;
|
import java.security.cert.Certificate;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public abstract class AbstractCertificateCryptor {
|
||||||
while (engineAliases.hasMoreElements()) {
|
while (engineAliases.hasMoreElements()) {
|
||||||
final Certificate certificate = certs.keyStore.engineGetCertificate(engineAliases.nextElement());
|
final Certificate certificate = certs.keyStore.engineGetCertificate(engineAliases.nextElement());
|
||||||
final byte[] otherPublicKeyHash = generatePublicKeyHash(certificate);
|
final byte[] otherPublicKeyHash = generatePublicKeyHash(certificate);
|
||||||
if (Objects.equals(otherPublicKeyHash, publicKeyHash)) {
|
if (Arrays.equals(otherPublicKeyHash, publicKeyHash)) {
|
||||||
return certificate;
|
return certificate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue