Skip to content

SpringComponentProvider in jersey-spring6 never binds components #5093

@wilkinsona

Description

@wilkinsona

It would appear that the jersey-spring6 artifact on Maven Central contains the result of compiling https://github.com/eclipse-ee4j/jersey/blob/3.x/ext/spring6/src/main/javaPre17/org/glassfish/jersey/server/spring/SpringComponentProvider.java rather than https://github.com/eclipse-ee4j/jersey/blob/3.x/ext/spring6/src/main/java17/org/glassfish/jersey/server/spring/SpringComponentProvider.java. I believe it needs to contain the result of compiling the latter to work correctly.

Looking at the bytecode using javap confirms that bind is hardcoded to return false:

javap -v -cp /Users/awilkinson/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-spring6/3.0.5/a3152fed45ab33faa41f9f6e3ed5edc238b4623e/jersey-spring6-3.0.5.jar org.glassfish.jersey.server.spring.SpringComponentProvider
Classfile jar:file:///Users/awilkinson/.gradle/caches/modules-2/files-2.1/org.glassfish.jersey.ext/jersey-spring6/3.0.5/a3152fed45ab33faa41f9f6e3ed5edc238b4623e/jersey-spring6-3.0.5.jar!/org/glassfish/jersey/server/spring/SpringComponentProvider.class
  Last modified 15 Jun 2022; size 1487 bytes
  SHA-256 checksum b9b42b44844fdc0b4b85732d6702bef08e19beff7bc8c05c95092855a554e487
  Compiled from "SpringComponentProvider.java"
  
  …
  
  public boolean bind(java.lang.Class<?>, java.util.Set<java.lang.Class<?>>);
    descriptor: (Ljava/lang/Class;Ljava/util/Set;)Z
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=1, locals=3, args_size=3
         0: iconst_0
         1: ireturn
      LineNumberTable:
        line 43: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0       2     0  this   Lorg/glassfish/jersey/server/spring/SpringComponentProvider;
            0       2     1 component   Ljava/lang/Class;
            0       2     2 providerContracts   Ljava/util/Set;
      LocalVariableTypeTable:
        Start  Length  Slot  Name   Signature
            0       2     1 component   Ljava/lang/Class<*>;
            0       2     2 providerContracts   Ljava/util/Set<Ljava/lang/Class<*>;>;
    Signature: #32                          // (Ljava/lang/Class<*>;Ljava/util/Set<Ljava/lang/Class<*>;>;)Z

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions