Commit 97acd20d authored by Phillip Webb's avatar Phillip Webb

Polish

parent a69f518c
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.cli.compiler; package org.springframework.boot.cli.compiler;
import org.codehaus.groovy.ast.ClassHelper; import org.codehaus.groovy.ast.ClassHelper;
...@@ -26,7 +27,6 @@ import org.codehaus.groovy.control.customizers.ImportCustomizer; ...@@ -26,7 +27,6 @@ import org.codehaus.groovy.control.customizers.ImportCustomizer;
* class with the same name is not already explicitly imported. * class with the same name is not already explicitly imported.
* *
* @author Dave Syer * @author Dave Syer
*
* @since 1.1 * @since 1.1
*/ */
class SmartImportCustomizer extends ImportCustomizer { class SmartImportCustomizer extends ImportCustomizer {
...@@ -40,8 +40,8 @@ class SmartImportCustomizer extends ImportCustomizer { ...@@ -40,8 +40,8 @@ class SmartImportCustomizer extends ImportCustomizer {
@Override @Override
public ImportCustomizer addImport(String alias, String className) { public ImportCustomizer addImport(String alias, String className) {
if (source.getAST() if (this.source.getAST().getImport(
.getImport(ClassHelper.make(className).getNameWithoutPackage()) == null) { ClassHelper.make(className).getNameWithoutPackage()) == null) {
super.addImport(alias, className); super.addImport(alias, className);
} }
return this; return this;
...@@ -50,8 +50,8 @@ class SmartImportCustomizer extends ImportCustomizer { ...@@ -50,8 +50,8 @@ class SmartImportCustomizer extends ImportCustomizer {
@Override @Override
public ImportCustomizer addImports(String... imports) { public ImportCustomizer addImports(String... imports) {
for (String alias : imports) { for (String alias : imports) {
if (source.getAST() if (this.source.getAST().getImport(
.getImport(ClassHelper.make(alias).getNameWithoutPackage()) == null) { ClassHelper.make(alias).getNameWithoutPackage()) == null) {
super.addImports(alias); super.addImports(alias);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment