From 140542e8b1f555d622578994b6c4f1b31b602238 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 26 Jun 2017 18:59:17 +0200 Subject: [PATCH] Polishing --- .../expression/spel/standard/SpelCompiler.java | 14 ++++++-------- .../MarshallingMessageConverterTests.java | 7 +++++-- .../oxm/jaxb/Jaxb2MarshallerTests.java | 18 ++++++------------ 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java b/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java index 7262d6fa3c..fd77cfd8d2 100644 --- a/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java +++ b/spring-expression/src/main/java/org/springframework/expression/spel/standard/SpelCompiler.java @@ -90,14 +90,13 @@ public class SpelCompiler implements Opcodes { /** - * Attempt compilation of the supplied expression. A check is - * made to see if it is compilable before compilation proceeds. The - * check involves visiting all the nodes in the expression Ast and - * ensuring enough state is known about them that bytecode can - * be generated for them. + * Attempt compilation of the supplied expression. A check is made to see + * if it is compilable before compilation proceeds. The check involves + * visiting all the nodes in the expression Ast and ensuring enough state + * is known about them that bytecode can be generated for them. * @param expression the expression to compile - * @return an instance of the class implementing the compiled expression, or null - * if compilation is not possible + * @return an instance of the class implementing the compiled expression, + * or {@code null} if compilation is not possible */ @Nullable public CompiledExpression compile(SpelNodeImpl expression) { @@ -193,7 +192,6 @@ public class SpelCompiler implements Opcodes { * because they anchor compiled classes in memory and prevent GC. If you have expressions * continually recompiling over time then by replacing the classloader periodically * at least some of the older variants can be garbage collected. - * * @param name name of the class * @param bytes bytecode for the class * @return the Class object for the compiled expression diff --git a/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java b/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java index 97ccbb3265..1cf81f4b7c 100644 --- a/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java +++ b/spring-jms/src/test/java/org/springframework/jms/support/converter/MarshallingMessageConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 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. @@ -44,14 +44,16 @@ public class MarshallingMessageConverterTests { private Session sessionMock; + @Before - public void setUp() throws Exception { + public void setup() throws Exception { marshallerMock = mock(Marshaller.class); unmarshallerMock = mock(Unmarshaller.class); sessionMock = mock(Session.class); converter = new MarshallingMessageConverter(marshallerMock, unmarshallerMock); } + @Test public void toBytesMessage() throws Exception { BytesMessage bytesMessageMock = mock(BytesMessage.class); @@ -102,4 +104,5 @@ public class MarshallingMessageConverterTests { Object result = converter.fromMessage(textMessageMock); assertEquals("Invalid result", result, unmarshalled); } + } diff --git a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java index 4db96d3b39..50e59cbd92 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java @@ -186,7 +186,7 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTeststest").withDifferenceEvaluator(ev)); } - // SPR-10806 - - @Test + @Test // SPR-10806 public void unmarshalStreamSourceWithXmlOptions() throws Exception { - final javax.xml.bind.Unmarshaller unmarshaller = mock(javax.xml.bind.Unmarshaller.class); Jaxb2Marshaller marshaller = new Jaxb2Marshaller() { @Override @@ -360,11 +356,8 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests createDummyType() { return null; } + }