Skip to content
Snippets Groups Projects
Verified Commit fa405791 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Typos and comments.

parent a47c1fae
No related branches found
No related tags found
2 merge requests!105Release 0.11.0,!78External IDs
Pipeline #42092 passed
This commit is part of merge request !105. Comments created here will be created in the context of that merge request.
# #
# This file is a part of the CaosDB Project. # This file is a part of the CaosDB Project.
# #
# Copyright (C) 2021 Timm Fitsche <t.fitschen@indiscale.com> # Copyright (C) 2021-2023 Timm Fitsche <t.fitschen@indiscale.com>
# Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2021-2023 IndiScale GmbH <info@indiscale.com>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
......
...@@ -29,7 +29,7 @@ import org.caosdb.server.database.exceptions.TransactionException; ...@@ -29,7 +29,7 @@ import org.caosdb.server.database.exceptions.TransactionException;
import org.caosdb.server.entity.EntityID; import org.caosdb.server.entity.EntityID;
/** /**
* Implements {@link SetQueryTemplateDefinitionImpl} for a MySQL/MariaDB back-end. * Implements {@link SetQueryTemplateDefinitionImpl} for a MariaDB back-end.
* *
* @author Timm Fitschen <t.fitschen@indiscale.com> * @author Timm Fitschen <t.fitschen@indiscale.com>
*/ */
......
...@@ -27,7 +27,7 @@ import org.caosdb.server.transaction.Transaction; ...@@ -27,7 +27,7 @@ import org.caosdb.server.transaction.Transaction;
/** /**
* An abstract layer for managing entity ids. * An abstract layer for managing entity ids.
* *
* <p>That is, checking wether something is a well-formed id, generating well-formed ids and more. * <p>That is, checking whether something is a well-formed id, generating well-formed ids and more.
* *
* <p>This class follows a Strategy Pattern. The actual implemenation can be found in one of the * <p>This class follows a Strategy Pattern. The actual implemenation can be found in one of the
* implementations of the {@link EntityIdRegistryStrategy} interface. * implementations of the {@link EntityIdRegistryStrategy} interface.
......
...@@ -579,6 +579,7 @@ public abstract class Job { ...@@ -579,6 +579,7 @@ public abstract class Job {
} }
resolvedEntity = null; resolvedEntity = null;
} else { } else {
// We want another version, throw away current result.
resolvedEntity = null; resolvedEntity = null;
} }
...@@ -590,14 +591,14 @@ public abstract class Job { ...@@ -590,14 +591,14 @@ public abstract class Job {
} }
} }
// find by name in the container... // Last resort: find by name ...
if (resolvedEntity == null && versionId == null) { if (resolvedEntity == null && versionId == null) {
// from current transaction's container // ... from current transaction's container
resolvedEntity = getEntityByName(name); resolvedEntity = getEntityByName(name);
} }
if (resolvedEntity == null && name != null) { if (resolvedEntity == null && name != null) {
// from database // ... from database
resolvedEntity = retrieveValidLazyEntityByName(name, resulting_version); resolvedEntity = retrieveValidLazyEntityByName(name, resulting_version);
} }
......
...@@ -36,7 +36,7 @@ import org.caosdb.server.transaction.Transaction; ...@@ -36,7 +36,7 @@ import org.caosdb.server.transaction.Transaction;
* or has been retrieved fully and so on. * or has been retrieved fully and so on.
* *
* <p>However, when the entities parents or properties are being retrieved after the transaction's * <p>However, when the entities parents or properties are being retrieved after the transaction's
* access has been released, a {@link IllegalStateException} will be thrown. * access has been released, an {@link IllegalStateException} will be thrown.
* *
* @author Timm Fitschen <t.fitschen@indiscale.com> * @author Timm Fitschen <t.fitschen@indiscale.com>
*/ */
......
...@@ -55,15 +55,15 @@ public class Schedule { ...@@ -55,15 +55,15 @@ public class Schedule {
} }
public ScheduledJob add(final Job j) { public ScheduledJob add(final Job j) {
final ScheduledJob ret = new ScheduledJob(j); final ScheduledJob scheduled = new ScheduledJob(j);
List<ScheduledJob> jobs = jobLists.get(ret.getTransactionStage().ordinal()); List<ScheduledJob> jobs = jobLists.get(scheduled.getTransactionStage().ordinal());
if (jobs == null) { if (jobs == null) {
jobs = new CopyOnWriteArrayList<ScheduledJob>(); jobs = new CopyOnWriteArrayList<ScheduledJob>();
jobLists.put(ret.getTransactionStage().ordinal(), jobs); jobLists.put(scheduled.getTransactionStage().ordinal(), jobs);
} }
if (!jobs.contains(ret)) { if (!jobs.contains(scheduled)) {
jobs.add(ret); jobs.add(scheduled);
return ret; return scheduled;
} }
return null; return null;
} }
......
...@@ -140,9 +140,11 @@ public final class CheckDatatypePresent extends EntityJob { ...@@ -140,9 +140,11 @@ public final class CheckDatatypePresent extends EntityJob {
} }
} }
/**
* If this is a record type property or a concrete property, assign the data type of the
* corresponding abstract property.
*/
private void inheritDatatypeFromAbstractEntity() throws Message { private void inheritDatatypeFromAbstractEntity() throws Message {
// if this is a record type property or a concrete property, assign
// the data type of the corresponding abstract property.
EntityInterface abstractProperty = resolve(getEntity()); EntityInterface abstractProperty = resolve(getEntity());
if (abstractProperty != null && abstractProperty.hasDatatype()) { if (abstractProperty != null && abstractProperty.hasDatatype()) {
getEntity().setDatatype(abstractProperty.getDatatype()); getEntity().setDatatype(abstractProperty.getDatatype());
......
...@@ -67,7 +67,7 @@ public class ResolveNames extends ContainerJob { ...@@ -67,7 +67,7 @@ public class ResolveNames extends ContainerJob {
.getEntity(); .getEntity();
e.setId(valid.getId()); e.setId(valid.getId());
} catch (final EntityDoesNotExistException exc) { } catch (final EntityDoesNotExistException exc) {
// definitely not an id. // Definitely not an existing id.
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment