You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2026/09/07 18:15:25 UTC
(cayenne) branch master updated: unused, removing
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push:
new e582e15f1 unused, removing
e582e15f1 is described below
commit e582e15f1e18010285dd38cce7175f20f8f0069b
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Mon Sep 7 14:15:19 2026 -0400
unused, removing
---
.../java/org/apache/cayenne/graph/GraphMap.java | 74 ----------------------
.../org/apache/cayenne/graph/GraphMapTest.java | 61 ------------------
2 files changed, 135 deletions(-)
diff --git a/cayenne/src/main/java/org/apache/cayenne/graph/GraphMap.java b/cayenne/src/main/java/org/apache/cayenne/graph/GraphMap.java
deleted file mode 100644
index e7d564993..000000000
--- a/cayenne/src/main/java/org/apache/cayenne/graph/GraphMap.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ****************************************************************/
-
-package org.apache.cayenne.graph;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A base implementation of GraphManager that stores graph nodes keyed by their ids.
- * <h3>Tracking Object Changes</h3>
- * <p>
- * Registered objects may choose to notify GraphMap of their changes by using callback
- * methods defined in GraphChangeHandler interface. GraphMap itself implements as noops,
- * leaving it up to subclasses to handle object updates.
- * </p>
- *
- * @since 1.2
- */
-public class GraphMap implements GraphManager {
-
- protected Map<Object, Object> nodes;
-
- /**
- * Creates a new GraphMap.
- */
- public GraphMap() {
- this.nodes = new HashMap<>();
- }
-
- // *** GraphMap methods
-
- /**
- * Returns an immutable collection of registered nodes.
- */
- @Override
- public Collection<Object> registeredNodes() {
- return Collections.unmodifiableCollection(nodes.values());
- }
-
- @Override
- public synchronized Object getNode(Object nodeId) {
- return nodes.get(nodeId);
- }
-
- @Override
- public synchronized void registerNode(Object nodeId, Object nodeObject) {
- nodes.put(nodeId, nodeObject);
- }
-
- @Override
- public synchronized Object unregisterNode(Object nodeId) {
- return nodes.remove(nodeId);
- }
-
-}
diff --git a/cayenne/src/test/java/org/apache/cayenne/graph/GraphMapTest.java b/cayenne/src/test/java/org/apache/cayenne/graph/GraphMapTest.java
deleted file mode 100644
index 27da9bb73..000000000
--- a/cayenne/src/test/java/org/apache/cayenne/graph/GraphMapTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ****************************************************************/
-
-package org.apache.cayenne.graph;
-
-import org.junit.jupiter.api.Test;
-
-import java.util.Collection;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertSame;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public class GraphMapTest {
-
- @Test
- public void registerNode() {
- GraphMap map = new GraphMap();
- Object node = new Object();
-
- map.registerNode("key", node);
- assertSame(node, map.getNode("key"));
- }
-
- @Test
- public void registeredNodes() {
- GraphMap map = new GraphMap();
- Object n1 = new Object();
- Object n2 = new Object();
-
- map.registerNode(n1, n1);
- map.registerNode(n2, n2);
-
- Collection nodes = map.registeredNodes();
- assertNotNull(nodes);
- assertEquals(2, nodes.size());
- assertTrue(nodes.contains(n1));
- assertTrue(nodes.contains(n2));
-
- assertThrows(UnsupportedOperationException.class, () -> nodes.add(new Object()),
- "Nodes collection is expected to be immutable.");
- }
-}