This is an automated email from the ASF dual-hosted git repository. ntimofeev pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
commit 4364861fb6d2afb001c55aac514fb19763f1e197 Author: stariy95 <stari...@gmail.com> AuthorDate: Wed Jan 10 16:34:25 2024 +0400 Code cleanup --- .../java/org/apache/cayenne/access/DataContextObjectCreator.java | 1 - cayenne/src/main/java/org/apache/cayenne/map/Attribute.java | 2 +- cayenne/src/main/java/org/apache/cayenne/map/ObjAttribute.java | 7 +++---- cayenne/src/main/java/org/apache/cayenne/map/ObjRelationship.java | 6 +++--- cayenne/src/main/java/org/apache/cayenne/util/XMLSerializable.java | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cayenne/src/main/java/org/apache/cayenne/access/DataContextObjectCreator.java b/cayenne/src/main/java/org/apache/cayenne/access/DataContextObjectCreator.java index 5f8ac5811..de7a5ebfa 100644 --- a/cayenne/src/main/java/org/apache/cayenne/access/DataContextObjectCreator.java +++ b/cayenne/src/main/java/org/apache/cayenne/access/DataContextObjectCreator.java @@ -192,7 +192,6 @@ class DataContextObjectCreator { * If ObjEntity qualifier is set, asks it to inject initial value to an object. * Also performs all Persistent initialization operations */ - @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") protected void injectInitialValue(Object obj) { // must follow this exact order of property initialization per CAY-653, // i.e. have the id and the context in place BEFORE setPersistence is called diff --git a/cayenne/src/main/java/org/apache/cayenne/map/Attribute.java b/cayenne/src/main/java/org/apache/cayenne/map/Attribute.java index e9cb8aa6f..4d4f9324a 100644 --- a/cayenne/src/main/java/org/apache/cayenne/map/Attribute.java +++ b/cayenne/src/main/java/org/apache/cayenne/map/Attribute.java @@ -57,7 +57,7 @@ public abstract class Attribute<E extends Entity<E, A, R>, A extends Attribute<E } @Override - public abstract void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate); + public abstract void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate); /** * Returns parent entity that holds this attribute. diff --git a/cayenne/src/main/java/org/apache/cayenne/map/ObjAttribute.java b/cayenne/src/main/java/org/apache/cayenne/map/ObjAttribute.java index 7fbb8e270..71a34c1b8 100644 --- a/cayenne/src/main/java/org/apache/cayenne/map/ObjAttribute.java +++ b/cayenne/src/main/java/org/apache/cayenne/map/ObjAttribute.java @@ -104,7 +104,7 @@ public class ObjAttribute extends Attribute<ObjEntity, ObjAttribute, ObjRelation * @since 1.1 */ @Override - public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) { + public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate) { encoder.start("obj-attribute") .attribute("name", getName()) .attribute("type", getType()) @@ -236,7 +236,6 @@ public class ObjAttribute extends Attribute<ObjEntity, ObjAttribute, ObjRelation return getDbPathIterator(getEntity()); } - @SuppressWarnings("unchecked") public Iterator<CayenneMapEntry> getDbPathIterator(ObjEntity entity) { if (dbAttributePath == null) { return Collections.emptyIterator(); @@ -264,8 +263,8 @@ public class ObjAttribute extends Attribute<ObjEntity, ObjAttribute, ObjRelation } /** - * Returns the the name of the mapped DbAttribute. This value is the same as - * "dbAttributePath" for regular attributes mapped to columns. It is equql + * Returns the name of the mapped DbAttribute. This value is the same as + * "dbAttributePath" for regular attributes mapped to columns. It is equal * to the last path component for the flattened attributes. */ public String getDbAttributeName() { diff --git a/cayenne/src/main/java/org/apache/cayenne/map/ObjRelationship.java b/cayenne/src/main/java/org/apache/cayenne/map/ObjRelationship.java index 419faa9e3..2e12bd5e0 100644 --- a/cayenne/src/main/java/org/apache/cayenne/map/ObjRelationship.java +++ b/cayenne/src/main/java/org/apache/cayenne/map/ObjRelationship.java @@ -89,7 +89,7 @@ public class ObjRelationship extends Relationship<ObjEntity, ObjAttribute, ObjRe @Override public ObjEntity getSourceEntity() { - return (ObjEntity) super.getSourceEntity(); + return super.getSourceEntity(); } /** @@ -105,7 +105,7 @@ public class ObjRelationship extends Relationship<ObjEntity, ObjAttribute, ObjRe * @since 1.1 */ @Override - public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) { + public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate) { ObjEntity source = getSourceEntity(); if (source == null) { return; @@ -759,7 +759,7 @@ public class ObjRelationship extends Relationship<ObjEntity, ObjAttribute, ObjRe @Override public boolean isMandatory() { refreshFromDeferredPath(); - if (dbRelationships.size() == 0) { + if (dbRelationships.isEmpty()) { return false; } diff --git a/cayenne/src/main/java/org/apache/cayenne/util/XMLSerializable.java b/cayenne/src/main/java/org/apache/cayenne/util/XMLSerializable.java index 9fbc116e4..a8e25b87b 100644 --- a/cayenne/src/main/java/org/apache/cayenne/util/XMLSerializable.java +++ b/cayenne/src/main/java/org/apache/cayenne/util/XMLSerializable.java @@ -32,5 +32,5 @@ public interface XMLSerializable { * * @since 1.1 */ - void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate); + void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate); }