Skip to content

Commit c71aa32

Browse files
committed
Polish
1 parent af36bf6 commit c71aa32

File tree

6 files changed

+17
-23
lines changed

6 files changed

+17
-23
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2015 the original author or authors.
2+
* Copyright 2012-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -549,19 +549,13 @@ private Archive createArchiveIfPossible(URL url)
549549
if (url.toString().endsWith(".jar") || url.toString().endsWith(".zip")) {
550550
return new JarFileArchive(new File(url.toURI()));
551551
}
552-
else if (url.toString().endsWith("/*")) {
552+
if (url.toString().endsWith("/*")) {
553553
String name = url.getFile();
554554
File dir = new File(name.substring(0, name.length() - 1));
555-
if (dir.exists()) {
556-
return new ExplodedArchive(new File(name.substring(0, name.length() - 1)),
557-
false);
558-
}
559-
}
560-
else {
561-
String filename = URLDecoder.decode(url.getFile(), "UTF-8");
562-
return new ExplodedArchive(new File(filename));
555+
return (dir.exists() ? new ExplodedArchive(dir, false) : null);
563556
}
564-
return null;
557+
String filename = URLDecoder.decode(url.getFile(), "UTF-8");
558+
return new ExplodedArchive(new File(filename));
565559
}
566560

567561
private void addNestedArchivesFromParent(List<Archive> urls) {

spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedServletContainerFactory.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,9 @@ public String getUriEncoding() {
600600

601601
private static class TomcatErrorPage {
602602

603-
private static final String ERROR_PAGE_TOMCAT7 = "org.apache.catalina.deploy.ErrorPage";
603+
private static final String ERROR_PAGE_CLASS = "org.apache.tomcat.util.descriptor.web.ErrorPage";
604604

605-
private static final String ERROR_PAGE_TOMCAT = "org.apache.tomcat.util.descriptor.web.ErrorPage";
605+
private static final String LEGACY_ERROR_PAGE_CLASS = "org.apache.catalina.deploy.ErrorPage";
606606

607607
private final String location;
608608

@@ -622,13 +622,13 @@ public TomcatErrorPage(ErrorPage errorPage) {
622622
private Object createNativePage(ErrorPage errorPage) {
623623
Object nativePage = null;
624624
try {
625-
if (ClassUtils.isPresent(ERROR_PAGE_TOMCAT, null)) {
626-
nativePage = BeanUtils.instantiate(ClassUtils
627-
.forName(ERROR_PAGE_TOMCAT, null));
625+
if (ClassUtils.isPresent(ERROR_PAGE_CLASS, null)) {
626+
nativePage = BeanUtils
627+
.instantiate(ClassUtils.forName(ERROR_PAGE_CLASS, null));
628628
}
629-
else if (ClassUtils.isPresent(ERROR_PAGE_TOMCAT7, null)) {
630-
nativePage = BeanUtils.instantiate(ClassUtils
631-
.forName(ERROR_PAGE_TOMCAT7, null));
629+
else if (ClassUtils.isPresent(LEGACY_ERROR_PAGE_CLASS, null)) {
630+
nativePage = BeanUtils.instantiate(
631+
ClassUtils.forName(LEGACY_ERROR_PAGE_CLASS, null));
632632
}
633633
}
634634
catch (ClassNotFoundException ex) {
@@ -643,7 +643,7 @@ else if (ClassUtils.isPresent(ERROR_PAGE_TOMCAT7, null)) {
643643
public void addToContext(Context context) {
644644
Assert.state(this.nativePage != null,
645645
"Neither Tomcat 7 nor 8 detected so no native error page exists");
646-
if (ClassUtils.isPresent(ERROR_PAGE_TOMCAT, null)) {
646+
if (ClassUtils.isPresent(ERROR_PAGE_CLASS, null)) {
647647
org.apache.tomcat.util.descriptor.web.ErrorPage errorPage = (org.apache.tomcat.util.descriptor.web.ErrorPage) this.nativePage;
648648
errorPage.setLocation(this.location);
649649
errorPage.setErrorCode(this.errorCode);

0 commit comments

Comments
 (0)