Test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces

Issue: SPR-11979
This commit is contained in:
Juergen Hoeller 2014-07-10 15:46:18 +02:00
parent eaad0a0f52
commit 29f6f3d7e7
2 changed files with 9 additions and 4 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,7 @@
package example.scannable; package example.scannable;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
@ -27,8 +28,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.DependsOn; import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.support.AbstractApplicationContext; import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.ResourcePatternResolver; import org.springframework.core.io.support.ResourcePatternResolver;
@ -43,6 +44,10 @@ import org.springframework.util.Assert;
@Service @Lazy @DependsOn("myNamedComponent") @Service @Lazy @DependsOn("myNamedComponent")
public class FooServiceImpl implements FooService { public class FooServiceImpl implements FooService {
// Just to test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces
private static final Comparator<MessageBean> COMPARATOR_BY_MESSAGE = Comparator.comparing(MessageBean::getMessage);
@Autowired private FooDao fooDao; @Autowired private FooDao fooDao;
@Autowired public BeanFactory beanFactory; @Autowired public BeanFactory beanFactory;
@ -65,6 +70,7 @@ public class FooServiceImpl implements FooService {
private boolean initCalled = false; private boolean initCalled = false;
@PostConstruct @PostConstruct
private void init() { private void init() {
if (this.initCalled) { if (this.initCalled) {

View File

@ -30,8 +30,7 @@ public final class SpringAsmInfo {
/** /**
* The ASM compatibility version for Spring's ASM visitor implementations: * The ASM compatibility version for Spring's ASM visitor implementations:
* as of Spring 4.0.3, it's ASM5. * currently {@link Opcodes#ASM5}.
* @see Opcodes#ASM5
*/ */
public static final int ASM_VERSION = Opcodes.ASM5; public static final int ASM_VERSION = Opcodes.ASM5;