Skip to content

Commit 192c8f5

Browse files
committed
Fix javadoc generation
Signed-off-by: Artur Souza <[email protected]>
1 parent d666d32 commit 192c8f5

File tree

5 files changed

+66
-15
lines changed

5 files changed

+66
-15
lines changed

.github/scripts/update_docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ rm -f daprdocs/content/en/java-sdk-docs/_index.mdbak || echo
2727
rm -f daprdocs/content/en/java-sdk-docs/spring-boot/_index.md/_index.mdbak || echo
2828

2929
rm -rf docs
30-
mvn -Dmaven.test.skip=false -Djacoco.skip=true clean install
31-
mvn site-deploy
30+
./mvnw -Dmaven.test.skip=false -Djacoco.skip=true clean install
31+
./mvnw site-deploy

.github/workflows/validate-docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Validate Javadocs Generation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
- release-*
9+
tags:
10+
- v*
11+
12+
pull_request:
13+
branches:
14+
- master
15+
- release-*
16+
17+
jobs:
18+
build:
19+
name: "Build jdk:${{ matrix.java }} sb:${{ matrix.spring-boot-display-version }} exp:${{ matrix.experimental }}"
20+
runs-on: github-arm64-2c-8gb
21+
timeout-minutes: 30
22+
continue-on-error: ${{ matrix.experimental }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
java: [ 17 ]
27+
spring-boot-version: [ 3.3.0 ]
28+
spring-boot-display-version: [ 3.3.x ]
29+
env:
30+
JDK_VER: ${{ matrix.java }}
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up OpenJDK ${{ env.JDK_VER }}
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: 'temurin'
37+
java-version: ${{ env.JDK_VER }}
38+
- name: Install jars
39+
run: ./mvnw install -q -B -DskipTests
40+
- name: Validate Java docs generation
41+
run: ./mvnw site-deploy

dapr-spring/dapr-spring-data/src/main/java/io/dapr/spring/data/PostgreSQLDaprKeyValueAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ private String createSql(String sqlPattern, String keyspace) {
152152
private String createSql(String sqlPattern, String keyspace, Object criteria) {
153153
String keyspaceFilter = getKeyspaceFilter(keyspace);
154154

155-
if (criteria instanceof DaprPredicate daprPredicate) {
155+
if (criteria instanceof DaprPredicate) {
156+
var daprPredicate = (DaprPredicate) criteria;
156157
String path = daprPredicate.getPath().toString();
157158
String pathWithOutType = String.format("'%s'", path.substring(path.indexOf(".") + 1));
158159
String value = String.format("'%s'", daprPredicate.getValue().toString());

dapr-spring/dapr-spring-data/src/main/java/io/dapr/spring/data/repository/query/DaprPredicateBuilder.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public Predicate<Object> isFalse() {
4646
public Predicate<Object> isEqualTo(Object value) {
4747
return new DaprPredicate(part.getProperty(), value, o -> {
4848
if (!ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
49-
if (o instanceof String s1 && value instanceof String s2) {
49+
if ((o instanceof String) && (value instanceof String)) {
50+
var s1 = (String)o;
51+
var s2 = (String)value;
5052
return s1.equalsIgnoreCase(s2);
5153
}
5254
}
@@ -85,7 +87,8 @@ public Predicate<Object> matches(Object value) {
8587
return ObjectUtils.nullSafeEquals(o, value);
8688
}
8789

88-
if (value instanceof Pattern pattern) {
90+
if (value instanceof Pattern) {
91+
var pattern = (Pattern)value;
8992
return pattern.matcher(o.toString()).find();
9093
}
9194

@@ -95,8 +98,10 @@ public Predicate<Object> matches(Object value) {
9598

9699
public Predicate<Object> in(Object value) {
97100
return new DaprPredicate(part.getProperty(), value, o -> {
98-
if (value instanceof Collection<?> collection) {
99-
if (o instanceof Collection<?> subSet) {
101+
if (value instanceof Collection<?>) {
102+
var collection = (Collection<?>)value;
103+
if (o instanceof Collection<?>) {
104+
var subSet = (Collection<?>)o;
100105
return collection.containsAll(subSet);
101106
}
102107

@@ -117,15 +122,17 @@ public Predicate<Object> contains(Object value) {
117122
return false;
118123
}
119124

120-
if (o instanceof Collection<?> collection) {
125+
if (o instanceof Collection<?>) {
126+
var collection = (Collection<?>)o;
121127
return collection.contains(value);
122128
}
123129

124130
if (ObjectUtils.isArray(o)) {
125131
return ObjectUtils.containsElement(ObjectUtils.toObjectArray(o), value);
126132
}
127133

128-
if (o instanceof Map<?, ?> map) {
134+
if (o instanceof Map<?, ?>) {
135+
var map = (Map<?, ?>)o;
129136
return map.containsValue(value);
130137
}
131138

@@ -145,9 +152,10 @@ public Predicate<Object> contains(Object value) {
145152

146153
public Predicate<Object> startsWith(Object value) {
147154
return new DaprPredicate(part.getProperty(), value, o -> {
148-
if (!(o instanceof String s)) {
155+
if (!(o instanceof String)) {
149156
return false;
150157
}
158+
var s = (String)o;
151159

152160
if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
153161
return s.startsWith(value.toString());
@@ -159,10 +167,11 @@ public Predicate<Object> startsWith(Object value) {
159167

160168
public Predicate<Object> endsWith(Object value) {
161169
return new DaprPredicate(part.getProperty(), value, o -> {
162-
if (!(o instanceof String s)) {
170+
if (!(o instanceof String)) {
163171
return false;
164172
}
165173

174+
var s = (String)o;
166175
if (ObjectUtils.nullSafeEquals(Part.IgnoreCaseType.NEVER, part.shouldIgnoreCase())) {
167176
return s.endsWith(value.toString());
168177
}

dapr-spring/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
<properties>
3030
<springboot.version>3.2.6</springboot.version>
31-
<maven.compiler.source>17</maven.compiler.source>
32-
<maven.compiler.target>17</maven.compiler.target>
33-
<maven.compiler.release>17</maven.compiler.release>
31+
<maven.compiler.source>11</maven.compiler.source>
32+
<maven.compiler.target>11</maven.compiler.target>
33+
<maven.compiler.release>11</maven.compiler.release>
3434
</properties>
3535

3636
<dependencyManagement>
@@ -108,7 +108,7 @@
108108
<plugin>
109109
<groupId>org.apache.maven.plugins</groupId>
110110
<artifactId>maven-javadoc-plugin</artifactId>
111-
<version>3.7.0</version>
111+
<version>3.2.0</version>
112112
<executions>
113113
<execution>
114114
<id>attach-javadocs</id>

0 commit comments

Comments
 (0)