diff options
author | Emmanuel Bourg <ebourg@apache.org> | 2017-10-25 11:33:11 +0200 |
---|---|---|
committer | Emmanuel Bourg <ebourg@apache.org> | 2017-10-25 11:33:11 +0200 |
commit | 86ee2f0c49ee1002a7bcd624aa105caba0166617 (patch) | |
tree | 8cbe1246ec1113a082e23057c986bd09a569e5ef /spring-context/src/main/java/org/springframework/context/expression | |
parent | 0ffebdadce315ab1d00dd5de08d285bbf54a851e (diff) |
New upstream version 4.3.12
Diffstat (limited to 'spring-context/src/main/java/org/springframework/context/expression')
3 files changed, 28 insertions, 25 deletions
diff --git a/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java b/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java index 50812c11..348e249d 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java +++ b/spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -75,6 +75,9 @@ public final class AnnotatedElementKey implements Comparable<AnnotatedElementKey public int compareTo(AnnotatedElementKey other) { int result = this.element.toString().compareTo(other.element.toString()); if (result == 0 && this.targetClass != null) { + if (other.targetClass == null) { + return 1; + } result = this.targetClass.getName().compareTo(other.targetClass.getName()); } return result; diff --git a/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java b/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java index 0593e26a..ec61732f 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java +++ b/spring-context/src/main/java/org/springframework/context/expression/MapAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2017 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. @@ -68,27 +68,6 @@ public class MapAccessor implements CompilablePropertyAccessor { map.put(name, newValue); } - - /** - * Exception thrown from {@code read} in order to reset a cached - * PropertyAccessor, allowing other accessors to have a try. - */ - @SuppressWarnings("serial") - private static class MapAccessException extends AccessException { - - private final String key; - - public MapAccessException(String key) { - super(null); - this.key = key; - } - - @Override - public String getMessage() { - return "Map does not contain a value for key '" + this.key + "'"; - } - } - @Override public boolean isCompilable() { return true; @@ -112,4 +91,25 @@ public class MapAccessor implements CompilablePropertyAccessor { mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get","(Ljava/lang/Object;)Ljava/lang/Object;",true); } + + /** + * Exception thrown from {@code read} in order to reset a cached + * PropertyAccessor, allowing other accessors to have a try. + */ + @SuppressWarnings("serial") + private static class MapAccessException extends AccessException { + + private final String key; + + public MapAccessException(String key) { + super(null); + this.key = key; + } + + @Override + public String getMessage() { + return "Map does not contain a value for key '" + this.key + "'"; + } + } + } diff --git a/spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java b/spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java index 29ff4fca..c48a3479 100644 --- a/spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java +++ b/spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2017 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. @@ -160,7 +160,7 @@ public class StandardBeanExpressionResolver implements BeanExpressionResolver { } return expr.getValue(sec); } - catch (Exception ex) { + catch (Throwable ex) { throw new BeanExpressionException("Expression parsing failed", ex); } } |