Skip to content

Commit 196adbd

Browse files
committed
Polishing
1 parent de93290 commit 196adbd

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

spring-context/src/main/java/org/springframework/scripting/groovy/GroovyScriptEvaluator.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
/*
2+
* Copyright 2002-2015 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springframework.scripting.groovy;
218

319
import java.io.IOException;
420
import java.util.Map;
521

622
import groovy.lang.Binding;
23+
import groovy.lang.GroovyRuntimeException;
724
import groovy.lang.GroovyShell;
8-
import org.codehaus.groovy.control.CompilationFailedException;
925

1026
import org.springframework.beans.factory.BeanClassLoaderAware;
1127
import org.springframework.scripting.ScriptCompilationException;
@@ -67,7 +83,7 @@ public Object evaluate(ScriptSource script, Map<String, Object> arguments) {
6783
catch (IOException ex) {
6884
throw new ScriptCompilationException(script, "Cannot access script", ex);
6985
}
70-
catch (CompilationFailedException ex) {
86+
catch (GroovyRuntimeException ex) {
7187
throw new ScriptCompilationException(script, "Evaluation failure", ex);
7288
}
7389
}

spring-core/src/main/java/org/springframework/core/ResolvableType.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.core;
1818

19-
import java.io.ObjectStreamException;
2019
import java.io.Serializable;
2120
import java.lang.reflect.Array;
2221
import java.lang.reflect.Constructor;
@@ -818,7 +817,7 @@ VariableResolver asVariableResolver() {
818817
/**
819818
* Custom serialization support for {@link #NONE}.
820819
*/
821-
private Object readResolve() throws ObjectStreamException {
820+
private Object readResolve() {
822821
return (this.type == null ? NONE : this);
823822
}
824823

0 commit comments

Comments
 (0)