Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifestations performance #124

Merged
merged 4 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Fixed

- Increased performance of reflection by 32.8%

## [9.2.0](https://github.com/dbmdz/metadata-service/releases/tag/9.2.0) - 2024-06-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion metasvc-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Client</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-lobid-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: lobid.org Client</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Model</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.slf4j.Logger;
Expand Down Expand Up @@ -41,22 +42,21 @@ public static <D extends Identifiable> D build(Identifiable identifiable, Class<
if (!identifiableGetter.getName().startsWith("get")) continue;
Type returnType = identifiableGetter.getGenericReturnType();
// ...find the corresponding setter of the new object...
Method[] setters =
String searchedSetter = "set" + identifiableGetter.getName().substring(3);
Optional<Method> setter =
derivedInstSetters.stream()
.filter(
derivSetter ->
derivSetter
.getName()
.equals(identifiableGetter.getName().replaceFirst("^get", "set"))
derivSetter.getName().equals(searchedSetter)
&& derivSetter.getParameterCount() == 1
&& derivSetter
.getParameters()[0]
.getParameterizedType()
.equals(returnType))
.toArray(i -> new Method[i]);
if (setters.length != 1) continue;
.findFirst();
if (setter.isEmpty()) continue;
// ...and invoke this setter with the getter's returned value
setters[0].invoke(derivedInst, identifiableGetter.invoke(identifiable));
setter.get().invoke(derivedInst, identifiableGetter.invoke(identifiable));
}
return derivedInst;
} catch (InstantiationException
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend API)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-file/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL File)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-inmemory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL InMemory)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL JDBI PostgreSql)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/backend-lobid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Backend IMPL External System lobid.org)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/business/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Business)</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server</name>
Expand Down
2 changes: 1 addition & 1 deletion metasvc-server/webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc-server</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
</parent>

<name>Metadata-Service: Repository Server (Webapp)</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>io.github.dbmdz.metadata</groupId>
<artifactId>metasvc</artifactId>
<version>9.2.0</version>
<version>9.2.1-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Metadata-Service</name>
Expand Down
Loading