From 29f6f3d7e73aa3d055c48049a7198306f5a9f4ba Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 10 Jul 2014 15:46:18 +0200 Subject: [PATCH] Test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces Issue: SPR-11979 --- .../test/java/example/scannable/FooServiceImpl.java | 10 ++++++++-- .../java/org/springframework/asm/SpringAsmInfo.java | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/spring-context/src/test/java/example/scannable/FooServiceImpl.java b/spring-context/src/test/java/example/scannable/FooServiceImpl.java index 15da02b0f2d..b63cfaf013c 100644 --- a/spring-context/src/test/java/example/scannable/FooServiceImpl.java +++ b/spring-context/src/test/java/example/scannable/FooServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -16,6 +16,7 @@ package example.scannable; +import java.util.Comparator; import java.util.List; import java.util.concurrent.Future; import javax.annotation.PostConstruct; @@ -27,8 +28,8 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.DependsOn; +import org.springframework.context.annotation.Lazy; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.ResourcePatternResolver; @@ -43,6 +44,10 @@ import org.springframework.util.Assert; @Service @Lazy @DependsOn("myNamedComponent") public class FooServiceImpl implements FooService { + // Just to test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces + private static final Comparator COMPARATOR_BY_MESSAGE = Comparator.comparing(MessageBean::getMessage); + + @Autowired private FooDao fooDao; @Autowired public BeanFactory beanFactory; @@ -65,6 +70,7 @@ public class FooServiceImpl implements FooService { private boolean initCalled = false; + @PostConstruct private void init() { if (this.initCalled) { diff --git a/spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java b/spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java index 3a8eb3f1201..409f00c81bf 100644 --- a/spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java +++ b/spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java @@ -30,8 +30,7 @@ public final class SpringAsmInfo { /** * The ASM compatibility version for Spring's ASM visitor implementations: - * as of Spring 4.0.3, it's ASM5. - * @see Opcodes#ASM5 + * currently {@link Opcodes#ASM5}. */ public static final int ASM_VERSION = Opcodes.ASM5;