[ 
https://issues.apache.org/jira/browse/BCEL-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomo Suzuki updated BCEL-323:
-----------------------------
    Description: 
fdh1. Problem

With OpenJDK 13 EA, BCELifer does not give "default" modifier for an 
[interface's default 
method|https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html].

[https://travis-ci.org/apache/commons-bcel/jobs/556441835]
{code:java}
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   BCELifierTestCase.testJavapCompare:90->testClassOnPath:80 
expected:<...a8Example {
 public [default ]void hello();
 Code:...> but was:<...a8Example {
 public []void hello();
 Code:...>
[INFO] 
[ERROR] Tests run: 130, Failures: 1, Errors: 0, Skipped: 1{code}
 

I'm checking why it fails.

Memo for myself:
{code:java}
export JAVA_HOME=${HOME}/local/jdk-13
export PATH=${JAVA_HOME}/bin:$PATH{code}
h1. Difference causing Test Failure

In OpenJDK 13, the default parameter for the interface disappears after 
BCELifier creates the class file.

!screenshot-1.png! 
  
{code:java}
$ java -version
openjdk version "13-ea" 2019-09-17
OpenJDK Runtime Environment (build 13-ea+28)
OpenJDK 64-Bit Server VM (build 13-ea+28, mixed mode, sharing){code}
h2. What does BCELifierTestCase do?

The test compares two output of javap command:
 * javap "target/test-classes/Java8Example.class" (which is copied from 
./src/test/resources/Java8Example.class in git)
 * javap another Java8Example.class which is generated by BCELifer.
 ** Actually the class file is not directly created by BCELifer.
 *** BCELifer writes Java8ExampleCreator.java
 *** The test runs "javac" to compile Java8ExampleCreator.
 *** The test runs "java" to run Java8ExampleCreator, which in turn generates 
Java8Example.class


h2. Question to Answer

Q. In theory, because Java8Example.class is generated by BCEL, not JDK, the 
output should not change. Which part of BCEL relies on JDK?

Q. Is there difference between Java8ExampleCreator.java files from JDK 8 and 
JDK 13?
A. They are the same.

Q. How to see the difference between Java8Example.class from JDK 8 and JDK 13?

* javap (screenshot shown above)
* binary diff editor


Q. Which part of BCEL/BCELifer is responsible to write "default" into class 
files.




  was:
fdh1. Problem

With OpenJDK 13 EA, BCELifer does not give "default" modifier for an 
[interface's default 
method|https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html].

[https://travis-ci.org/apache/commons-bcel/jobs/556441835]
{code:java}
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   BCELifierTestCase.testJavapCompare:90->testClassOnPath:80 
expected:<...a8Example {
 public [default ]void hello();
 Code:...> but was:<...a8Example {
 public []void hello();
 Code:...>
[INFO] 
[ERROR] Tests run: 130, Failures: 1, Errors: 0, Skipped: 1{code}
 

I'm checking why it fails.

Memo for myself:
{code:java}
export JAVA_HOME=${HOME}/local/jdk-13
export PATH=${JAVA_HOME}/bin:$PATH{code}
h1. Difference causing Test Failure

In OpenJDK 13, the default parameter for the interface disappears after 
BCELifier creates the class file.

!screenshot-1.png! 
  
{code:java}
$ java -version
openjdk version "13-ea" 2019-09-17
OpenJDK Runtime Environment (build 13-ea+28)
OpenJDK 64-Bit Server VM (build 13-ea+28, mixed mode, sharing){code}
h2. What does BCELifierTestCase do?

The test compares two output of javap command:
 * javap "target/test-classes/Java8Example.class" (which is copied from 
./src/test/resources/Java8Example.class in git)
 * javap another Java8Example.class which is generated by BCELifer.
 ** Actually the class file is not directly created by BCELifer.
 *** BCELifer writes Java8ExampleCreator.java
 *** The test runs "javac" to compile Java8ExampleCreator.
 *** The test runs "java" to run Java8ExampleCreator, which in turn generates 
Java8Example.class


h2. Question to Answer

Q. In theory, because Java8Example.class is generated by BCEL, not JDK, the 
output should not change. Which part of BCEL relies on JDK?

Q. Is there difference between Java8ExampleCreator.java files from JDK 8 and 
JDK 13?
A. They are the same.







> JDK 13 build failing in master: BCELifierTestCase.testJavapCompare
> ------------------------------------------------------------------
>
>                 Key: BCEL-323
>                 URL: https://issues.apache.org/jira/browse/BCEL-323
>             Project: Commons BCEL
>          Issue Type: Improvement
>            Reporter: Tomo Suzuki
>            Priority: Minor
>         Attachments: screenshot-1.png
>
>
> fdh1. Problem
> With OpenJDK 13 EA, BCELifer does not give "default" modifier for an 
> [interface's default 
> method|https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html].
> [https://travis-ci.org/apache/commons-bcel/jobs/556441835]
> {code:java}
> [INFO] 
> [INFO] Results:
> [INFO] 
> [ERROR] Failures: 
> [ERROR]   BCELifierTestCase.testJavapCompare:90->testClassOnPath:80 
> expected:<...a8Example {
>  public [default ]void hello();
>  Code:...> but was:<...a8Example {
>  public []void hello();
>  Code:...>
> [INFO] 
> [ERROR] Tests run: 130, Failures: 1, Errors: 0, Skipped: 1{code}
>  
> I'm checking why it fails.
> Memo for myself:
> {code:java}
> export JAVA_HOME=${HOME}/local/jdk-13
> export PATH=${JAVA_HOME}/bin:$PATH{code}
> h1. Difference causing Test Failure
> In OpenJDK 13, the default parameter for the interface disappears after 
> BCELifier creates the class file.
> !screenshot-1.png! 
>   
> {code:java}
> $ java -version
> openjdk version "13-ea" 2019-09-17
> OpenJDK Runtime Environment (build 13-ea+28)
> OpenJDK 64-Bit Server VM (build 13-ea+28, mixed mode, sharing){code}
> h2. What does BCELifierTestCase do?
> The test compares two output of javap command:
>  * javap "target/test-classes/Java8Example.class" (which is copied from 
> ./src/test/resources/Java8Example.class in git)
>  * javap another Java8Example.class which is generated by BCELifer.
>  ** Actually the class file is not directly created by BCELifer.
>  *** BCELifer writes Java8ExampleCreator.java
>  *** The test runs "javac" to compile Java8ExampleCreator.
>  *** The test runs "java" to run Java8ExampleCreator, which in turn generates 
> Java8Example.class
> h2. Question to Answer
> Q. In theory, because Java8Example.class is generated by BCEL, not JDK, the 
> output should not change. Which part of BCEL relies on JDK?
> Q. Is there difference between Java8ExampleCreator.java files from JDK 8 and 
> JDK 13?
> A. They are the same.
> Q. How to see the difference between Java8Example.class from JDK 8 and JDK 13?
> * javap (screenshot shown above)
> * binary diff editor
> Q. Which part of BCEL/BCELifer is responsible to write "default" into class 
> files.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to