Skip to content

Commit 10a0390

Browse files
committed
Test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces
Issue: SPR-11979 (cherry picked from commit 29f6f3d)
1 parent 7de42ef commit 10a0390

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

spring-context/src/test/java/example/scannable/FooServiceImpl.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package example.scannable;
1818

19+
import java.util.Comparator;
1920
import java.util.List;
2021
import java.util.concurrent.Future;
2122
import javax.annotation.PostConstruct;
@@ -27,8 +28,8 @@
2728
import org.springframework.context.ApplicationEventPublisher;
2829
import org.springframework.context.ConfigurableApplicationContext;
2930
import org.springframework.context.MessageSource;
30-
import org.springframework.context.annotation.Lazy;
3131
import org.springframework.context.annotation.DependsOn;
32+
import org.springframework.context.annotation.Lazy;
3233
import org.springframework.context.support.AbstractApplicationContext;
3334
import org.springframework.core.io.ResourceLoader;
3435
import org.springframework.core.io.support.ResourcePatternResolver;
@@ -43,6 +44,10 @@
4344
@Service @Lazy @DependsOn("myNamedComponent")
4445
public class FooServiceImpl implements FooService {
4546

47+
// Just to test ASM5's bytecode parsing of INVOKESPECIAL/STATIC on interfaces
48+
private static final Comparator<MessageBean> COMPARATOR_BY_MESSAGE = Comparator.comparing(MessageBean::getMessage);
49+
50+
4651
@Autowired private FooDao fooDao;
4752

4853
@Autowired public BeanFactory beanFactory;
@@ -65,6 +70,7 @@ public class FooServiceImpl implements FooService {
6570

6671
private boolean initCalled = false;
6772

73+
6874
@PostConstruct
6975
private void init() {
7076
if (this.initCalled) {

spring-core/src/main/java/org/springframework/asm/SpringAsmInfo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public final class SpringAsmInfo {
3030

3131
/**
3232
* The ASM compatibility version for Spring's ASM visitor implementations:
33-
* as of Spring 4.0.3, it's ASM5.
34-
* @see Opcodes#ASM5
33+
* currently {@link Opcodes#ASM5}.
3534
*/
3635
public static final int ASM_VERSION = Opcodes.ASM5;
3736

0 commit comments

Comments
 (0)