Enable compile linting and treat warnings as errors

Closes gh-232
This commit is contained in:
Andy Wilkinson
2024-07-25 10:09:33 +01:00
parent 662fcca552
commit 7dbb2cbba8
17 changed files with 42 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
*/
package com.example.data.mongodb;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;
public class LineItem {
@@ -31,7 +31,7 @@ public class LineItem {
this.price = price;
}
@PersistenceConstructor
@PersistenceCreator
public LineItem(String caption, double price, int quantity) {
this(caption, price);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2022 the original author or authors.
* Copyright 2022-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.data.mongodb.core.index.IndexDefinition;
@@ -87,7 +87,7 @@ public class Order {
this(customerId, null);
}
@PersistenceConstructor
@PersistenceCreator
public Order(String id, String customerId, Date orderDate, List<LineItem> items) {
this.id = id;