diff --git a/spring-boot/src/main/java/org/springframework/boot/web/support/ErrorPageFilter.java b/spring-boot/src/main/java/org/springframework/boot/web/support/ErrorPageFilter.java index 877673b493d3..6d95f306f726 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/support/ErrorPageFilter.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/support/ErrorPageFilter.java @@ -223,12 +223,12 @@ private String getErrorPath(Class type) { if (this.subtypes.containsKey(type)) { return this.exceptions.get(this.subtypes.get(type)); } - Class subtype = type; - while (subtype != Object.class) { - subtype = subtype.getSuperclass(); - if (this.exceptions.containsKey(subtype)) { - this.subtypes.put(subtype, type); - return this.exceptions.get(subtype); + Class supertype = type; + while (supertype != Object.class) { + supertype = supertype.getSuperclass(); + if (this.exceptions.containsKey(supertype)) { + this.subtypes.put(type, supertype); + return this.exceptions.get(supertype); } } return this.global;