Skip to content

Commit 99ff619

Browse files
Cleanup
1 parent 5e7bb5d commit 99ff619

12 files changed

Lines changed: 256 additions & 12 deletions

File tree

.run/Run Benchmark.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<configuration default="false" name="Run Benchmark" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.spring.data.eclipse.store.benchmark.BenchmarkRunner" />
44
<module name="spring-data-eclipse-store-benchmark" />
5-
<option name="VM_PARAMETERS" value="-Xmx24g --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED" />
5+
<option name="VM_PARAMETERS" value="--add-opens java.base/java.util=ALL-UNNAMED" />
66
<extension name="coverage">
77
<pattern>
88
<option name="PATTERN" value="software.xdev.spring.data.eclipse.store.benchmark.benchmarks.simple.user.*" />

.run/Run Complex Demo.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<configuration default="false" name="Run Complex Demo" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication" />
44
<module name="spring-data-eclipse-store-demo" />
5-
<option name="VM_PARAMETERS" value="--add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED" />
5+
<option name="VM_PARAMETERS" value="--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED" />
66
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
77
<extension name="coverage">
88
<pattern>

.run/Run Simple Demo.run.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<configuration default="false" name="Run Simple Demo" type="Application" factoryName="Application">
33
<option name="MAIN_CLASS_NAME" value="software.xdev.spring.data.eclipse.store.demo.simple.SimpleDemoApplication" />
44
<module name="spring-data-eclipse-store-demo" />
5-
<option name="VM_PARAMETERS" value="--add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED" />
65
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
76
<extension name="coverage">
87
<pattern>

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,17 @@ more [complex demo](./spring-data-eclipse-store-demo/src/main/java/software/xdev
7676
> [!NOTE]
7777
> Since the library is using reflection to copy data, the following JVM-Arguments may have to be set:
7878
> ```
79-
> --add-opens=java.base/java.lang=ALL-UNNAMED
80-
> --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
8179
> --add-opens=java.base/java.util=ALL-UNNAMED
80+
> --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
81+
> --add-opens=java.base/java.lang=ALL-UNNAMED
8282
> --add-opens=java.base/java.time=ALL-UNNAMED
8383
> ```
8484
8585
8686
## Support
87-
If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support).
87+
88+
If you need support as soon as possible, and you can't wait for any pull request, feel free to
89+
use [our support](https://xdev.software/en/services/support).
8890
8991
## Contributing
9092
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.

spring-data-eclipse-store/pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,7 @@
295295
<configuration>
296296
<argLine>
297297
--add-opens java.base/java.util=ALL-UNNAMED
298-
--add-opens java.base/java.lang=ALL-UNNAMED
299-
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
300298
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED
301-
-Djdk.reflect.useDirectMethodHandle=false
302299
</argLine>
303300
</configuration>
304301
</plugin>

spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/exceptions/MergeFailedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public MergeFailedException(final Object sourceObject, final Object targetObject
2121
{
2222
super(
2323
String.format(
24-
"Could not merge values of object %s# with object %s",
24+
"Could not merge values of object %s with object %s",
2525
sourceObject.getClass().getName(),
2626
targetObject.getClass().getName()
2727
),

spring-data-eclipse-store/src/main/java/software/xdev/spring/data/eclipse/store/repository/EclipseStoreStorage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import jakarta.inject.Inject;
2727
import jakarta.inject.Named;
2828

29+
import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsList12;
30+
import org.eclipse.serializer.persistence.binary.jdk17.java.util.BinaryHandlerImmutableCollectionsSet12;
2931
import org.eclipse.serializer.persistence.types.Storer;
3032
import org.eclipse.store.integrations.spring.boot.types.EclipseStoreProvider;
3133
import org.eclipse.store.integrations.spring.boot.types.configuration.EclipseStoreProperties;
@@ -88,6 +90,8 @@ private synchronized void ensureEntitiesInRoot()
8890
this.root = new Root();
8991
final EmbeddedStorageFoundation<?> embeddedStorageFoundation =
9092
this.storeProvider.createStorageFoundation(this.storeConfiguration);
93+
embeddedStorageFoundation.registerTypeHandler(BinaryHandlerImmutableCollectionsSet12.New());
94+
embeddedStorageFoundation.registerTypeHandler(BinaryHandlerImmutableCollectionsList12.New());
9195
this.storageManager = embeddedStorageFoundation.start(this.root);
9296
this.persistenceChecker = new RelayedPersistenceChecker(embeddedStorageFoundation);
9397
this.initRoot();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright © 2023 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.repositories;
17+
18+
import org.springframework.data.repository.CrudRepository;
19+
20+
21+
public interface CustomerRepositoryWithNonFinalHashSet extends CrudRepository<CustomerWithNonFinalHashSet, String>
22+
{
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* Copyright © 2023 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.repositories;
17+
18+
import java.util.HashSet;
19+
import java.util.List;
20+
import java.util.Objects;
21+
import java.util.Set;
22+
23+
24+
public class CustomerWithNonFinalHashSet
25+
{
26+
private String firstName;
27+
private String lastName;
28+
29+
private Set<String> values = new HashSet<>();
30+
31+
public CustomerWithNonFinalHashSet(final String firstName, final String lastName)
32+
{
33+
this.firstName = firstName;
34+
this.lastName = lastName;
35+
}
36+
37+
public void setValues(final Set<String> values)
38+
{
39+
this.values = values;
40+
}
41+
42+
public String getFirstName()
43+
{
44+
return this.firstName;
45+
}
46+
47+
public void setFirstName(final String firstName)
48+
{
49+
this.firstName = firstName;
50+
}
51+
52+
public String getLastName()
53+
{
54+
return this.lastName;
55+
}
56+
57+
public void setLastName(final String lastName)
58+
{
59+
this.lastName = lastName;
60+
}
61+
62+
public Set<String> getValues()
63+
{
64+
return this.values;
65+
}
66+
67+
@Override
68+
public String toString()
69+
{
70+
return String.format(
71+
"Customer[firstName='%s', lastName='%s']",
72+
this.firstName, this.lastName);
73+
}
74+
75+
@Override
76+
public boolean equals(final Object o)
77+
{
78+
if(this == o)
79+
{
80+
return true;
81+
}
82+
if(o == null || this.getClass() != o.getClass())
83+
{
84+
return false;
85+
}
86+
final CustomerWithNonFinalHashSet customer = (CustomerWithNonFinalHashSet)o;
87+
return Objects.equals(this.firstName, customer.firstName) && Objects.equals(
88+
this.lastName,
89+
customer.lastName);
90+
}
91+
92+
@Override
93+
public int hashCode()
94+
{
95+
return Objects.hash(this.firstName, this.lastName);
96+
}
97+
98+
@SuppressWarnings("OptionalGetWithoutIsPresent")
99+
public static CustomerWithNonFinalHashSet getCustomerWithFirstName(
100+
final List<CustomerWithNonFinalHashSet> customers,
101+
final String firstName)
102+
{
103+
return customers.stream().filter(customer -> customer.getFirstName().equals(firstName)).findFirst().get();
104+
}
105+
}

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/repositories/Node.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class Node
2424
{
2525
private String name;
2626

27-
private final List<Node> children;
27+
private List<Node> children;
2828

2929
public Node(final String name, final List<Node> children)
3030
{
@@ -47,6 +47,11 @@ public void setName(final String name)
4747
this.name = name;
4848
}
4949

50+
public void setChildren(final List<Node> children)
51+
{
52+
this.children = children;
53+
}
54+
5055
public List<Node> getChildren()
5156
{
5257
return this.children;

0 commit comments

Comments
 (0)