[
https://issues.apache.org/jira/browse/FELIX-532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587560#action_12587560
]
Stuart McCulloch commented on FELIX-532:
----------------------------------------
This is the disassembled bytecode from target=1.1
=======================================================================
Compiled from "JdbcTemplateExample.java"
public class mypackage.JdbcTemplateExample extends java.lang.Object{
public mypackage.JdbcTemplateExample();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: new #2; //class org/springframework/jdbc/core/JdbcTemplate
3: dup
4: invokespecial #3; //Method
org/springframework/jdbc/core/JdbcTemplate."<init>":()V
7: astore_1
8: aload_1
9: aconst_null
10: invokevirtual #4; //Method
org/springframework/jdbc/support/JdbcAccessor.setDataSource:(Ljavax/sql/DataSource;)V
13: return
}
=======================================================================
and this is the disassembled bytecode from target=1.2
=======================================================================
Compiled from "JdbcTemplateExample.java"
public class mypackage.JdbcTemplateExample extends java.lang.Object{
public mypackage.JdbcTemplateExample();
Code:
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: new #2; //class org/springframework/jdbc/core/JdbcTemplate
3: dup
4: invokespecial #3; //Method
org/springframework/jdbc/core/JdbcTemplate."<init>":()V
7: astore_1
8: aload_1
9: aconst_null
10: invokevirtual #4; //Method
org/springframework/jdbc/core/JdbcTemplate.setDataSource:(Ljavax/sql/DataSource;)V
13: return
}
=======================================================================
Note the subtle difference in the instruction on bytecode position 10:
10: invokevirtual #4; //Method
org/springframework/jdbc/support/JdbcAccessor.setDataSource:(Ljavax/sql/DataSource;)V
10: invokevirtual #4; //Method
org/springframework/jdbc/core/JdbcTemplate.setDataSource:(Ljavax/sql/DataSource;)V
this is because of a change in the JVM runtime specification (I don't remember
the details right now - will need to dig them up)
> Package inheritance dependencies are not imported when maven-compiler-plugin
> is defined in build
> ------------------------------------------------------------------------------------------------
>
> Key: FELIX-532
> URL: https://issues.apache.org/jira/browse/FELIX-532
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.0
> Environment: JDK 1.5.0_14 on Windows XP
> Reporter: James Rowe
> Assignee: Stuart McCulloch
> Priority: Minor
> Attachments: package-inheritance-test.zip
>
>
> When maven-compiler-plugin is explicitly added to the build, inheritance
> dependencies are not resolved. For example, the attached test case uses
> org.springframework.jdbc.core.JdbcTemplate, which extends
> org.springframework.jdbc.support.JdbcAccessor (note the superclass lives in a
> different package). The method we invoke is defined on JdbcAccessor, hence
> the inheritance dependency. When the compiler plugin is included in the
> build, the bundle plugin fails to import the inherited
> org.springframework.jdbc.support package dependency. When the compiler
> plugin is taken out of the build, the bundle plugin correctly imports it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.