Skip to content

Commit a9ba837

Browse files
committed
typos, cleanup
1 parent 074cd9e commit a9ba837

9 files changed

Lines changed: 39 additions & 40 deletions

File tree

cayenne-crypto/src/main/java/org/apache/cayenne/crypto/transformer/bytes/CbcDecryptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* A {@link BytesDecryptor} that decrypts the provided bytes that were encrypted
35-
* by the complimentary {@link CbcEncryptor}. The object is stateful and is not
35+
* by the complementary {@link CbcEncryptor}. The object is stateful and is not
3636
* thread-safe.
3737
*
3838
* @since 4.0

cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/token/MergerToken.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public interface MergerToken extends Comparable<MergerToken> {
4141
MergeDirection getDirection();
4242

4343
/**
44-
* Create a complimentary token with the reverse direction. AddColumn in one direction becomes
44+
* Create a complementary token with the reverse direction. AddColumn in one direction becomes
4545
* DropColumn in the other direction.
4646
* <p>
4747
* Not all tokens are reversible.

cayenne/src/main/java/org/apache/cayenne/access/ObjectDiff.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class ObjectDiff extends NodeDiff {
6565
private Map<ArcOperation, ArcOperation> flatIds;
6666
private Map<ArcOperation, ArcOperation> phantomFks;
6767

68-
private Persistent object;
68+
private final Persistent object;
6969

7070
ObjectDiff(final Persistent object) {
7171

@@ -244,11 +244,11 @@ void addDiff(NodeDiff diff, ObjectStore parent) {
244244
}
245245
} else if (property.getComplimentaryReverseArc() == null) {
246246

247-
// register complimentary arc diff
247+
// register complementary arc diff
248248
ArcId arc = arcId.getReverseId();
249249
//new ArcId(ASTDbPath.DB_PREFIX + property.getComplimentaryReverseDbRelationshipPath(), property.getName());
250-
ArcOperation complimentaryOp = new ArcOperation(targetId, arcDiff.getNodeId(), arc, arcDiff.isDelete());
251-
parent.registerDiff(targetId, complimentaryOp);
250+
ArcOperation complementaryOp = new ArcOperation(targetId, arcDiff.getNodeId(), arc, arcDiff.isDelete());
251+
parent.registerDiff(targetId, complementaryOp);
252252
}
253253

254254
} else if (property instanceof ToOneProperty) {
@@ -455,9 +455,9 @@ void updateArcSnapshot(String propertyName, Persistent object) {
455455

456456
static final class ArcOperation extends NodeDiff {
457457

458-
private Object targetNodeId;
459-
private ArcId arcId;
460-
private boolean delete;
458+
private final Object targetNodeId;
459+
private final ArcId arcId;
460+
private final boolean delete;
461461

462462
ArcOperation(Object nodeId, Object targetNodeId, ArcId arcId, boolean delete) {
463463

cayenne/src/main/java/org/apache/cayenne/map/EntityResolver.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,8 @@
1919

2020
package org.apache.cayenne.map;
2121

22-
import java.io.IOException;
23-
import java.io.ObjectInputStream;
24-
import java.io.Serializable;
25-
import java.lang.annotation.Annotation;
26-
import java.lang.reflect.Method;
27-
28-
import java.util.ArrayList;
29-
import java.util.Collection;
30-
import java.util.Collections;
31-
import java.util.EnumMap;
32-
import java.util.Map;
33-
import java.util.concurrent.atomic.AtomicLong;
34-
3522
import org.apache.cayenne.Persistent;
3623
import org.apache.cayenne.access.types.ValueObjectTypeRegistry;
37-
3824
import org.apache.cayenne.annotation.PostAdd;
3925
import org.apache.cayenne.annotation.PostLoad;
4026
import org.apache.cayenne.annotation.PostPersist;
@@ -55,6 +41,18 @@
5541
import org.slf4j.Logger;
5642
import org.slf4j.LoggerFactory;
5743

44+
import java.io.IOException;
45+
import java.io.ObjectInputStream;
46+
import java.io.Serializable;
47+
import java.lang.annotation.Annotation;
48+
import java.lang.reflect.Method;
49+
import java.util.ArrayList;
50+
import java.util.Collection;
51+
import java.util.Collections;
52+
import java.util.EnumMap;
53+
import java.util.Map;
54+
import java.util.concurrent.atomic.AtomicLong;
55+
5856
/**
5957
* Represents a virtual shared namespace for zero or more DataMaps. Unlike
6058
* DataMap, EntityResolver is intended to work as a runtime container of
@@ -67,10 +65,11 @@
6765
*/
6866
public class EntityResolver implements MappingNamespace, Serializable {
6967

70-
protected static final Logger logger = LoggerFactory.getLogger(EntityResolver.class);
68+
private static final Logger LOGGER = LoggerFactory.getLogger(EntityResolver.class);
7169
protected static AtomicLong incrementer = new AtomicLong();
7270

7371
protected static final Map<LifecycleEvent, Class<? extends Annotation>> LIFECYCLE_EVENT_MAP;
72+
7473
static {
7574
LIFECYCLE_EVENT_MAP = new EnumMap<>(LifecycleEvent.class);
7675
LIFECYCLE_EVENT_MAP.put(LifecycleEvent.POST_ADD, PostAdd.class);
@@ -152,8 +151,9 @@ public void applyDBLayerDefaults() {
152151
reverse.setRuntime(true);
153152
targetEntity.addRelationship(reverse);
154153

155-
logger.info("added runtime complimentary DbRelationship from " + targetEntity.getName()
156-
+ " to " + reverse.getTargetEntityName());
154+
LOGGER.info("added complementary runtime DbRelationship from {} to {}",
155+
targetEntity.getName(),
156+
reverse.getTargetEntityName());
157157
}
158158
}
159159
}
@@ -166,7 +166,7 @@ private String getUniqueRelationshipName(DbEntity entity) {
166166

167167
do {
168168
name = "runtimeRelationship" + incrementer.getAndIncrement();
169-
} while(entity.getRelationship(name) != null);
169+
} while (entity.getRelationship(name) != null);
170170

171171
return name;
172172
}
@@ -185,7 +185,7 @@ synchronized void initCallbacks() {
185185
// load annotated methods
186186
for (Method m : entityClass.getDeclaredMethods()) {
187187
LIFECYCLE_EVENT_MAP.forEach((eventType, annotationType) -> {
188-
if(m.getDeclaredAnnotation(annotationType) != null) {
188+
if (m.getDeclaredAnnotation(annotationType) != null) {
189189
callbackRegistry.addCallback(eventType, entityClass, m);
190190
}
191191
});
@@ -460,8 +460,7 @@ public EntityInheritanceTree getInheritanceTree(String entityName) {
460460
* ObjEntity that maps to the services the specified class
461461
*
462462
* @return the required ObjEntity or null if there is none that matches the
463-
* specifier
464-
*
463+
* specifier
465464
* @since 4.0
466465
*/
467466
public ObjEntity getObjEntity(Class<?> entityClass) {
@@ -492,7 +491,7 @@ public synchronized void removeDataMap(DataMap map) {
492491
/**
493492
* Returns an object that compiles and stores {@link ClassDescriptor}
494493
* instances for all entities.
495-
*
494+
*
496495
* @since 3.0
497496
*/
498497
public ClassDescriptorMap getClassDescriptorMap() {

cayenne/src/main/java/org/apache/cayenne/map/ObjRelationship.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public ObjEntity getTargetEntity() {
160160
}
161161

162162
/**
163-
* Returns the name of a complimentary relationship going in the opposite
163+
* Returns the name of a complementary relationship going in the opposite
164164
* direction or null if it doesn't exist.
165165
*
166166
* @since 1.2
@@ -171,7 +171,7 @@ public String getReverseRelationshipName() {
171171
}
172172

173173
/**
174-
* Returns a "complimentary" ObjRelationship going in the opposite
174+
* Returns a "complementary" ObjRelationship going in the opposite
175175
* direction. Returns null if no such relationship is found.
176176
*/
177177
@Override
@@ -226,7 +226,7 @@ public ObjRelationship getReverseRelationship() {
226226
}
227227

228228
/**
229-
* Creates a complimentary reverse relationship from target entity to the
229+
* Creates a complementary reverse relationship from target entity to the
230230
* source entity. A new relationship is created regardless of whether one
231231
* already exists. Returned relationship is not attached to the source
232232
* entity and has no name. Throws a {@link CayenneRuntimeException} if

cayenne/src/main/java/org/apache/cayenne/map/Relationship.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public void setRuntime(boolean synthetic) {
177177
}
178178

179179
/**
180-
* Returns a "complimentary" relationship going in the opposite direction. Returns
180+
* Returns a "complementary" relationship going in the opposite direction. Returns
181181
* null if no such relationship is found.
182182
* @since 3.1
183183
*/

cayenne/src/main/java/org/apache/cayenne/reflect/ArcProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface ArcProperty extends PropertyDescriptor {
4545
String getComplimentaryReverseDbRelationshipPath();
4646

4747
/**
48-
* Returns a complimentary reverse ArcProperty or null if no reverse arc
48+
* Returns a complementary reverse ArcProperty or null if no reverse arc
4949
* exists.
5050
*/
5151
ArcProperty getComplimentaryReverseArc();

cayenne/src/main/java/org/apache/cayenne/reflect/BaseArcProperty.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
public abstract class BaseArcProperty extends BaseProperty implements ArcProperty {
3030

31-
protected String complimentaryReverseArcName;
31+
protected String complementaryReverseArcName;
3232
protected ClassDescriptor targetDescriptor;
3333
protected ObjRelationship relationship;
3434
protected CayennePath reverseDbPath;
@@ -39,7 +39,7 @@ public BaseArcProperty(ClassDescriptor owner, ClassDescriptor targetDescriptor,
3939
super(owner, accessor);
4040

4141
this.targetDescriptor = targetDescriptor;
42-
this.complimentaryReverseArcName = reverseName;
42+
this.complementaryReverseArcName = reverseName;
4343
this.relationship = owner.getEntity().getRelationship(getName());
4444
}
4545

@@ -62,7 +62,7 @@ public ObjRelationship getRelationship() {
6262
}
6363

6464
public ArcProperty getComplimentaryReverseArc() {
65-
return (ArcProperty) targetDescriptor.getProperty(complimentaryReverseArcName);
65+
return (ArcProperty) targetDescriptor.getProperty(complementaryReverseArcName);
6666
}
6767

6868
public ClassDescriptor getTargetDescriptor() {

docs/asciidoc/getting-started-guide/src/docs/asciidoc/_getting-started-guide/object-relational-mapping.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ image::modeler-dbrelationship.png[align="center"]
7171

7272
- Click "Done" to confirm the changes and close the dialog.
7373

74-
- Two complimentary relationships have been created - from ARTIST to PAINTING
74+
- Two complementary relationships have been created - from ARTIST to PAINTING
7575
and back.
7676

7777
- Repeat the steps above to create a many-to-one relationship from PAINTING to GALLERY, calling the relationships pair

0 commit comments

Comments
 (0)