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

Apply Spring boot 3.4 suggestions #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -26,7 +26,7 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
// especially for rendering k8s_env.html
hints.reflection().registerType(Map.Entry.class, MemberCategory.values());
// hints.reflection().registerType(HashMap.class, MemberCategory.values());
// Innere Klassen
// inner classes
hints.reflection().registerTypeIfPresent(classLoader, "java.util.HashMap$Node"
, MemberCategory.values());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.Optional;

@Component
@DependsOnDatabaseInitialization
public class CounterService {

private static final Logger log = LoggerFactory.getLogger(CounterService.class);
Expand Down Expand Up @@ -56,7 +55,7 @@ private void initCounter() {

Optional<CounterEntity> counter = counterRepository.findById(ID);

if(!counter.isPresent()) {
if(counter.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prüft .isEmpty auch auf null oder nur auf "=0"? :D

CounterEntity newEntity = new CounterEntity();
newEntity.setId(ID);
newEntity.setCounter(0L);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ logging.level.de.viadee=debug

spring.jpa.hibernate.ddl-auto=update

server.tomcat.max-threads=2
server.tomcat.threads.max=2

management.endpoints.enabled-by-default=true
management.endpoints.access.default=read-only
management.endpoints.web.exposure.include=*
management.health.db.enabled=true
management.endpoint.health.show-details=always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class TestappApplicationTests {
class TestappApplicationTests {

@Test
public void contextLoads() {
@Test
void contextLoads() {
}

}
Loading