Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ public static byte[] getPayloadAsByteArray(final Section payload) {
return null;
}

if (payload instanceof Data) {
final Data body = (Data) payload;
if (payload instanceof Data body) {
return body.getValue().getArray();
} else if (payload instanceof AmqpValue) {
final AmqpValue body = (AmqpValue) payload;
} else if (payload instanceof AmqpValue body) {
if (body.getValue() instanceof byte[]) {
return (byte[]) body.getValue();
} else if (body.getValue() instanceof String &&
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<version>3.5.4</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/io/cloudevents/core/CloudEventUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ private CloudEventUtils() {}
* @return the reader implementation
*/
public static CloudEventReader toReader(CloudEvent event) {
if (event instanceof CloudEventReader) {
return (CloudEventReader) event;
if (event instanceof CloudEventReader reader) {
return reader;
} else {
return new CloudEventReaderAdapter(event);
}
Expand All @@ -63,8 +63,8 @@ public static CloudEventReader toReader(CloudEvent event) {
* @return the context reader implementation
*/
public static CloudEventContextReader toContextReader(CloudEventContext event) {
if (event instanceof CloudEventContextReader) {
return (CloudEventContextReader) event;
if (event instanceof CloudEventContextReader reader) {
return reader;
} else {
return new CloudEventContextReaderAdapter(event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public void readAttributes(CloudEventContextWriter writer) throws RuntimeExcepti
public void readExtensions(CloudEventContextWriter writer) throws RuntimeException {
for (String key : event.getExtensionNames()) {
Object value = event.getExtension(key);
if (value instanceof String) {
writer.withContextAttribute(key, (String) value);
} else if (value instanceof Number) {
writer.withContextAttribute(key, (Number) value);
} else if (value instanceof Boolean) {
writer.withContextAttribute(key, (Boolean) value);
} else if (value instanceof URI) {
writer.withContextAttribute(key, (URI) value);
} else if (value instanceof OffsetDateTime) {
writer.withContextAttribute(key, (OffsetDateTime) value);
if (value instanceof String string) {
writer.withContextAttribute(key, string);
} else if (value instanceof Number number) {
writer.withContextAttribute(key, number);
} else if (value instanceof Boolean boolean1) {
writer.withContextAttribute(key, boolean1);
} else if (value instanceof URI rI) {
writer.withContextAttribute(key, rI);
} else if (value instanceof OffsetDateTime time) {
writer.withContextAttribute(key, time);
} else {
// This should never happen because we build that map only through our builders
throw new IllegalStateException("Illegal value inside extensions map: " + key + " " + value);
Expand Down
1 change: 0 additions & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<module>amqp-proton</module>
<module>spring-reactive</module>
<module>spring-rsocket</module>
<module>spring-function</module>
<module>rocketmq</module>
</modules>

Expand Down
2 changes: 1 addition & 1 deletion examples/restful-ws-microprofile-liberty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<version>3.5.4</version>
<executions>
<execution>
<phase>integration-test</phase>
Expand Down
6 changes: 3 additions & 3 deletions examples/restful-ws-spring-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<properties>
<module-name>cloudevents.example.spring.boot</module-name>
<spring-boot.version>4.0.0</spring-boot.version>
<spring.version>7.0.2</spring.version>
<spring-boot.version>4.0.2</spring-boot.version>
<spring.version>7.0.4</spring.version>
</properties>

<dependencyManagement>
Expand All @@ -32,7 +32,7 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
Expand Down
75 changes: 0 additions & 75 deletions examples/spring-function/README.md

This file was deleted.

84 changes: 0 additions & 84 deletions examples/spring-function/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

Loading