Skip to content

Commit e36ec8a

Browse files
authored
Scope Jakarta Validation API to REST modules (#19447)
* Scope Jakarta Validation API to REST modules * Clarify why REST excludes the duplicate Javassist dependency
1 parent 96a0c6d commit e36ec8a

27 files changed

Lines changed: 63 additions & 93 deletions

File tree

‎external-service-impl/rest/pom.xml‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,7 @@
6565
<groupId>com.sun.activation</groupId>
6666
<artifactId>jakarta.activation</artifactId>
6767
</exclusion>
68-
<!-- repeated in datanode -->
69-
<exclusion>
70-
<groupId>jakarta.validation</groupId>
71-
<artifactId>jakarta.validation-api</artifactId>
72-
</exclusion>
73-
<!-- repeated in datanode -->
68+
<!-- Use the Javassist dependency supplied by Jersey HK2 at runtime. -->
7469
<exclusion>
7570
<groupId>org.javassist</groupId>
7671
<artifactId>javassist</artifactId>
@@ -84,13 +79,6 @@
8479
<dependency>
8580
<groupId>org.glassfish.jersey.containers</groupId>
8681
<artifactId>jersey-container-servlet-core</artifactId>
87-
<exclusions>
88-
<!-- repeated in datanode -->
89-
<exclusion>
90-
<groupId>jakarta.validation</groupId>
91-
<artifactId>jakarta.validation-api</artifactId>
92-
</exclusion>
93-
</exclusions>
9482
</dependency>
9583
<dependency>
9684
<groupId>org.eclipse.jetty.ee10</groupId>

‎integration-test/pom.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@
180180
<groupId>org.apache.thrift</groupId>
181181
<artifactId>libthrift</artifactId>
182182
</dependency>
183-
<dependency>
184-
<groupId>jakarta.validation</groupId>
185-
<artifactId>jakarta.validation-api</artifactId>
186-
</dependency>
187183
<dependency>
188184
<groupId>org.apache.iotdb</groupId>
189185
<artifactId>iotdb-confignode</artifactId>

‎integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
package org.apache.iotdb.it.env.cluster.config;
2121

22-
import jakarta.validation.constraints.NotNull;
23-
22+
import javax.annotation.Nonnull;
2423
import javax.annotation.Nullable;
2524

2625
import java.io.FileWriter;
@@ -62,7 +61,7 @@ protected MppBaseConfig(String filePath) throws IOException {
6261
*
6362
* @param properties the properties to update with.
6463
*/
65-
public final void updateProperties(@NotNull Properties properties) {
64+
public final void updateProperties(@Nonnull Properties properties) {
6665
properties.forEach((k, v) -> this.setProperty((String) k, (String) v));
6766
}
6867

@@ -72,7 +71,7 @@ public final void updateProperties(@NotNull Properties properties) {
7271
*
7372
* @param persistentConfig the config instance to update with.
7473
*/
75-
public void updateProperties(@NotNull MppBaseConfig persistentConfig) {
74+
public void updateProperties(@Nonnull MppBaseConfig persistentConfig) {
7675
updateProperties(persistentConfig.properties);
7776
}
7877

@@ -112,15 +111,15 @@ public final void persistent(String filePath) throws IOException {
112111
* @param key the key.
113112
* @param value the value.
114113
*/
115-
protected final void setProperty(@NotNull String key, String value) {
114+
protected final void setProperty(@Nonnull String key, String value) {
116115
if (!value.equals(NULL_VALUE)) {
117116
properties.setProperty(key, value);
118117
} else {
119118
properties.remove(key);
120119
}
121120
}
122121

123-
public final String getProperty(@NotNull String key, String defaultValue) {
122+
public final String getProperty(@Nonnull String key, String defaultValue) {
124123
return properties.getProperty(key, defaultValue);
125124
}
126125

‎iotdb-core/confignode/pom.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@
123123
<groupId>org.apache.ratis</groupId>
124124
<artifactId>ratis-common</artifactId>
125125
</dependency>
126-
<dependency>
127-
<groupId>jakarta.validation</groupId>
128-
<artifactId>jakarta.validation-api</artifactId>
129-
</dependency>
130126
<dependency>
131127
<groupId>org.apache.ratis</groupId>
132128
<artifactId>ratis-thirdparty-misc</artifactId>

‎iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/response/cq/ShowCQResp.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
2626
import org.apache.iotdb.consensus.common.DataSet;
2727

28-
import jakarta.validation.constraints.NotNull;
28+
import javax.annotation.Nonnull;
2929

3030
import java.util.Comparator;
3131
import java.util.List;
@@ -36,7 +36,7 @@ public class ShowCQResp implements DataSet {
3636
private final TSStatus status;
3737
private final List<CQInfo.CQEntry> cqList;
3838

39-
public ShowCQResp(@NotNull TSStatus status, @NotNull List<CQInfo.CQEntry> cqList) {
39+
public ShowCQResp(@Nonnull TSStatus status, @Nonnull List<CQInfo.CQEntry> cqList) {
4040
this.status = status;
4141
this.cqList = cqList;
4242
}

‎iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/response/externalservice/ShowExternalServiceResp.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.apache.iotdb.consensus.common.DataSet;
2626
import org.apache.iotdb.rpc.TSStatusCode;
2727

28-
import jakarta.validation.constraints.NotNull;
28+
import javax.annotation.Nonnull;
2929

3030
import java.util.Comparator;
3131
import java.util.List;
@@ -34,7 +34,7 @@ public class ShowExternalServiceResp implements DataSet {
3434

3535
private final List<TExternalServiceEntry> serviceInfoEntryList;
3636

37-
public ShowExternalServiceResp(@NotNull List<TExternalServiceEntry> serviceInfoEntryList) {
37+
public ShowExternalServiceResp(@Nonnull List<TExternalServiceEntry> serviceInfoEntryList) {
3838
this.serviceInfoEntryList = serviceInfoEntryList;
3939
}
4040

‎iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/schema/ClusterSchemaQuotaStatistics.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
package org.apache.iotdb.confignode.manager.schema;
2020

21-
import jakarta.validation.constraints.NotNull;
21+
import javax.annotation.Nonnull;
2222

2323
import java.util.Map;
2424
import java.util.Set;
@@ -38,11 +38,11 @@ public ClusterSchemaQuotaStatistics(long seriesThreshold, long deviceThreshold)
3838
this.deviceThreshold = deviceThreshold;
3939
}
4040

41-
public void updateTimeSeriesUsage(@NotNull Map<Integer, Long> seriesUsage) {
41+
public void updateTimeSeriesUsage(@Nonnull Map<Integer, Long> seriesUsage) {
4242
seriesCountMap.putAll(seriesUsage);
4343
}
4444

45-
public void updateDeviceUsage(@NotNull Map<Integer, Long> deviceUsage) {
45+
public void updateDeviceUsage(@Nonnull Map<Integer, Long> deviceUsage) {
4646
deviceCountMap.putAll(deviceUsage);
4747
}
4848

‎iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/mnode/container/ConfigMNodeContainer.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.apache.iotdb.commons.schema.node.utils.IMNodeContainer;
2222
import org.apache.iotdb.confignode.persistence.schema.mnode.IConfigMNode;
2323

24-
import jakarta.validation.constraints.NotNull;
24+
import javax.annotation.Nonnull;
2525

2626
import java.util.AbstractMap;
2727
import java.util.Collection;
@@ -69,18 +69,18 @@ public IConfigMNode get(Object key) {
6969
}
7070

7171
@Override
72-
@NotNull
72+
@Nonnull
7373
public Set<String> keySet() {
7474
return emptySet();
7575
}
7676

7777
@Override
78-
@NotNull
78+
@Nonnull
7979
public Collection<IConfigMNode> values() {
8080
return emptySet();
8181
}
8282

83-
@NotNull
83+
@Nonnull
8484
public Set<Entry<String, IConfigMNode>> entrySet() {
8585
return emptySet();
8686
}

‎iotdb-core/datanode/pom.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@
203203
<groupId>commons-cli</groupId>
204204
<artifactId>commons-cli</artifactId>
205205
</dependency>
206-
<dependency>
207-
<groupId>jakarta.validation</groupId>
208-
<artifactId>jakarta.validation-api</artifactId>
209-
</dependency>
210206
<dependency>
211207
<groupId>org.reflections</groupId>
212208
<artifactId>reflections</artifactId>

‎iotdb-core/datanode/src/main/java/org/apache/iotdb/db/audit/DNAuditLogger.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
import org.apache.tsfile.enums.TSDataType;
4646
import org.apache.tsfile.utils.Binary;
4747

48-
import jakarta.validation.constraints.NotNull;
49-
48+
import javax.annotation.Nonnull;
5049
import javax.annotation.Nullable;
5150

5251
import java.util.Arrays;
@@ -80,14 +79,14 @@ public void setCoordinator(Coordinator coordinator) {
8079
DNAuditLoggerHolder.INSTANCE.coordinator = coordinator;
8180
}
8281

83-
@NotNull
82+
@Nonnull
8483
private static InsertRowStatement generateInsertStatement(
8584
IAuditEntity auditLogFields, String log, PartialPath logDevice) {
8685
return generateInsertStatement(
8786
auditLogFields, log, logDevice, CommonDateTimeUtils.currentTime());
8887
}
8988

90-
@NotNull
89+
@Nonnull
9190
static InsertRowStatement generateInsertStatement(
9291
IAuditEntity auditLogFields, String log, PartialPath logDevice, long logTimestamp) {
9392
String username = auditLogFields.getUsername();

0 commit comments

Comments
 (0)